0

Fixed/added some config parsing tests

This commit is contained in:
Andrew Chin
2012-01-02 01:10:43 -05:00
parent a1dc392526
commit c14cd1a66f
5 changed files with 39 additions and 17 deletions

View File

@@ -7,5 +7,6 @@ render["world"] = {
}
render["otherworld"] = {
"rendermode": "foo"
"rendermode": "foo",
"bgcolor": "#ffffff"
}

View File

@@ -0,0 +1,6 @@
bgcolor="#000000"
render["world"] = {
"worldpath": "test/data/settings/test_world",
"bgcolor":"ffff"
}

View File

@@ -15,6 +15,7 @@ class SettingsTest(unittest.TestCase):
things = s.get_render_things()
# no exceptions so far. that's good
self.assertEquals(things['world']['bgcolor'], (26,26,26,0))
self.assertEquals(things['otherworld']['bgcolor'], (255,255,255,0))
def test_rendermode_validation(self):
s = configParser.MultiWorldParser("test/data/settings/settings_test_rendermode.py")
@@ -22,5 +23,12 @@ class SettingsTest(unittest.TestCase):
self.assertRaises(ValidationException,s.validate)
def test_bgcolor_validation(self):
s = configParser.MultiWorldParser("test/data/settings/settings_test_bgcolor.py")
s.parse()
self.assertRaises(ValidationException, s.validate)
if __name__ == "__main__":
unittest.main()