Added tests for optparse's 'float' and 'complex' types

This commit is contained in:
ymdatta 2018-10-28 22:16:03 +05:30
parent 6341d1382e
commit ccd9beb26d

View file

@ -23,6 +23,14 @@ def test_to_optparse():
assert optparse_opt.action == 'count'
def test_to_support_optparses_standard_types():
"""Show that optparse converts float and complex types correctly."""
opt = manager.Option('-t', '--test')
assert type(opt.normalize_from_setuptools(float(2))) == float
assert type(opt.normalize_from_setuptools(complex(2))) == complex
@mock.patch('optparse.Option')
def test_to_optparse_creates_an_option_as_we_expect(Option): # noqa: N803
"""Show that we pass all keyword args to optparse.Option."""