def test_parse(self): conf = """ group: var1: val var2: 234 var3: [1, 2, 3] var4: [] """ f = io.StringIO(conf) config.parse_config(f) g = config.get_group("group") self.assertEqual(g.var1, "val") self.assertEqual(g.var2, 234) self.assertEqual(g.var3, [1, 2, 3]) self.assertEqual(g.var4, [])
def test_parse(self): conf = ''' group: var1: val var2: 234 var3: [1, 2, 3] var4: [] ''' f = io.StringIO(conf) config.parse_config(f) g = config.get_group('group') self.assertEqual(g.var1, 'val') self.assertEqual(g.var2, 234) self.assertEqual(g.var3, [1, 2, 3]) self.assertEqual(g.var4, [])
def test_parse(self): conf = "bad config" f = io.StringIO(conf) # this shouldn't raise with self.assertRaises(config.ConfigError): config.parse_config(f)