0

Changed "worldname" to "world" in configfile

Also brought tests up to date. All tests pass now.
This commit is contained in:
Andrew Brown
2012-02-14 20:39:05 -05:00
parent f3b434a327
commit aaf8e1d7cb
10 changed files with 81 additions and 57 deletions

View File

@@ -21,12 +21,12 @@ class SettingsTest(unittest.TestCase):
# no exceptions so far. that's a good thing
# Test the default
self.assertEquals(things['render']['myworld']['bgcolor'], (26,26,26,0))
self.assertEquals(things['renders']['myworld']['bgcolor'], (26,26,26,0))
# Test a non-default
self.assertEquals(things['render']['otherworld']['bgcolor'], (255,255,255,0))
self.assertEquals(things['renders']['otherworld']['bgcolor'], (255,255,255,0))
self.assertEquals(things['render']['myworld']['northdirection'],
self.assertEquals(things['renders']['myworld']['northdirection'],
world.UPPER_LEFT)
def test_rendermode_validation(self):
@@ -42,20 +42,20 @@ class SettingsTest(unittest.TestCase):
fromfile = configParser.MultiWorldParser()
fromfile.parse("test/data/settings/settings_test_1.py")
self.s.set_config_item("world", {
self.s.set_config_item("worlds", {
'test': "test/data/settings/test_world",
})
self.s.set_config_item("render", {
self.s.set_config_item("renders", {
"myworld": {
"title": "myworld title",
"worldname": "test",
"world": "test",
"rendermode": rendermodes.normal,
"northdirection": "upper-left",
},
"otherworld": {
"title": "otherworld title",
"worldname": "test",
"world": "test",
"rendermode": rendermodes.normal,
"bgcolor": "#ffffff"
},
@@ -64,20 +64,20 @@ class SettingsTest(unittest.TestCase):
self.assertEquals(fromfile.get_validated_config(), self.s.get_validated_config())
def test_rendermode_string(self):
self.s.set_config_item("world", {
self.s.set_config_item("worlds", {
'test': "test/data/settings/test_world",
})
self.s.set_config_item("outputdir", "/tmp/fictional/outputdir")
self.s.set_config_item("render", {
self.s.set_config_item("renders", {
"myworld": {
"title": "myworld title",
"worldname": "test",
"world": "test",
"rendermode": "normal",
"northdirection": "upper-left",
},
})
p = self.s.get_validated_config()
self.assertEquals(p['render']['myworld']['rendermode'], rendermodes.normal)
self.assertEquals(p['renders']['myworld']['rendermode'], rendermodes.normal)
if __name__ == "__main__":
unittest.main()