def test_normalize_paths_callback(values, parsed_value, expected_value):
"""Assert our normalize_paths_callback behaves the right way."""
dest = 'exclude'
opt_str = '--exclude'
option = optparse.Option(opt_str, dest=dest)
parser = mock.Mock(values=optparse.Values(values))
options.normalize_paths_callback(option, opt_str, parsed_value, parser)
assert getattr(parser.values, dest) == expected_value
评论列表
文章目录