예제 #1
0
 def test_escape_equals(self):
     lib = Importer().import_class_or_module('libswithargs.Mixed',
                                             [r'default\=b', r'mandatory\=a'])
     assert_equal(lib.get_args(), (r'default\=b', r'mandatory\=a', ''))
     lib = Importer().import_class_or_module('libswithargs.Mixed',
                                             [r'default\=b', 'default=a'])
     assert_equal(lib.get_args(), (r'default\=b', 'a', ''))
 def test_with_arguments(self):
     lib = Importer().import_class_or_module('libswithargs.Mixed', range(5))
     assert_equals(lib.get_args(), (0, 1, '2 3 4'))
예제 #3
0
 def test_escaping_not_needed_if_args_do_not_match_names(self):
     lib = Importer().import_class_or_module('libswithargs.Mixed',
                                             ['foo=b', 'bar=a'])
     assert_equal(lib.get_args(), ('foo=b', 'bar=a', ''))
예제 #4
0
 def test_named_arguments(self):
     lib = Importer().import_class_or_module('libswithargs.Mixed',
                                             ['default=b', 'mandatory=a'])
     assert_equal(lib.get_args(), ('a', 'b', ''))