Fix prompt_optionlist test.
The problem was passing a dict when fake_prompt_optionlist Also using "new_callable" instead of "new" argument for @patch
This commit is contained in:
parent
3295edbfcc
commit
bb61793442
|
@ -12,10 +12,9 @@ import tempfile
|
|||
|
||||
|
||||
def fake_prompt_optionlist(input_list):
|
||||
|
||||
def fakereturns():
|
||||
def fr(_):
|
||||
return input_list.pop(0)
|
||||
return fakereturns
|
||||
return fr
|
||||
|
||||
|
||||
class TestThong(unittest.TestCase):
|
||||
|
@ -27,16 +26,19 @@ class TestThong(unittest.TestCase):
|
|||
print "TEAR DOWN"
|
||||
|
||||
@patch("pythong.project.prompt_optionlist",
|
||||
new_callable=fake_prompt_optionlist([{"Development Status": None,
|
||||
"None": None,
|
||||
"Operating Systems": None,
|
||||
"Linux": None,
|
||||
"Fedora": None}]))
|
||||
def test_optionlist(self, arg2):
|
||||
print arg2
|
||||
new=fake_prompt_optionlist(["Development Status",
|
||||
None,
|
||||
"Operating System",
|
||||
"POSIX",
|
||||
"Linux"]
|
||||
)
|
||||
)
|
||||
|
||||
def test_optionlist(self):
|
||||
from pythong.classifiers import CLASSIFIERS
|
||||
from pythong.project import recurse_prompt
|
||||
assert(recurse_prompt(CLASSIFIERS) == "Operating Systems :: Linux :: Fedora")
|
||||
assert(recurse_prompt(CLASSIFIERS) is None)
|
||||
assert(recurse_prompt(CLASSIFIERS) == "Operating System :: POSIX :: Linux")
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Reference in New Issue