Beispiel #1
0
 def test_assemble_option_dict(self):
     input = utils.extract_name_value("a=1 bbb=2.0 cdef=hol%s" % chr(224))
     self.assertEquals(
         utils.assemble_option_dict(input, self.optionspec), {"a": 1, "bbb": 2.0, "cdef": ("hol%s" % chr(224))}
     )
     input = utils.extract_name_value("a=1 b=2.0 c=hol%s" % chr(224))
     self.assertRaises(KeyError, utils.assemble_option_dict, input, self.optionspec)
     input = utils.extract_name_value("a=1 bbb=two cdef=hol%s" % chr(224))
     self.assertRaises(ValueError, utils.assemble_option_dict, input, self.optionspec)
Beispiel #2
0
 def test_assemble_option_dict(self):
     input = utils.extract_name_value('a=1 bbb=2.0 cdef=hol%s' % chr(224))
     self.assertEqual(
           utils.assemble_option_dict(input, self.optionspec),
           {'a': 1, 'bbb': 2.0, 'cdef': ('hol%s' % chr(224))})
     input = utils.extract_name_value('a=1 b=2.0 c=hol%s' % chr(224))
     self.assertRaises(KeyError, utils.assemble_option_dict,
                       input, self.optionspec)
     input = utils.extract_name_value('a=1 bbb=two cdef=hol%s' % chr(224))
     self.assertRaises(ValueError, utils.assemble_option_dict,
                       input, self.optionspec)
Beispiel #3
0
 def test_assemble_option_dict(self):
     input = utils.extract_name_value('a=1 bbb=2.0 cdef=hol%s' % chr(224))
     self.assertEquals(
           utils.assemble_option_dict(input, self.optionspec),
           {'a': 1, 'bbb': 2.0, 'cdef': ('hol%s' % chr(224))})
     input = utils.extract_name_value('a=1 b=2.0 c=hol%s' % chr(224))
     self.assertRaises(KeyError, utils.assemble_option_dict,
                       input, self.optionspec)
     input = utils.extract_name_value('a=1 bbb=two cdef=hol%s' % chr(224))
     self.assertRaises(ValueError, utils.assemble_option_dict,
                       input, self.optionspec)