def test_list(self): self.assertEqual([1, 2, 3], plan.parse_spec('foo=[1,2,3]')['foo']) self.assertEqual([1.1, 1.2, 1.3], plan.parse_spec('foo=[1.1, 1.2, 1.3]')['foo']) self.assertEqual(dict(foo=[1, 2], bar=[True, False], par=[3, 4]), plan.parse_spec('foo=[1,2],bar=[True,False],par=[3,4]')) self.assertEqual(dict(meh='mehmeh', foo=[1, 2], bar='barbar'), plan.parse_spec('meh=mehmeh,foo=[1,2],bar=barbar'))
def test_boolean(self): self.assertTrue(plan.parse_spec('foo=True')['foo']) self.assertFalse(plan.parse_spec('foo=False')['foo'])
def test_well_formed(self): self.assertEqual(dict(str='str', three=3, half=0.5), plan.parse_spec('str=str,three=3,half=0.5'))