0
This repository has been archived on 2025-04-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Minecraft-Overviewer/test/test_settings.py
2012-01-02 00:03:10 -05:00

27 lines
924 B
Python

import unittest
from overviewer_core import configParser
from overviewer_core.settingsValidators import ValidationException
class SettingsTest(unittest.TestCase):
def test_missing(self):
"Validates that a non-existant settings.py causes an exception"
self.assertRaises(ValueError, configParser.MultiWorldParser, "doesnotexist.py")
def test_existing_file(self):
s = configParser.MultiWorldParser("test/data/settings/settings_test_1.py")
s.parse()
s.validate()
things = s.get_render_things()
# no exceptions so far. that's good
self.assertEquals(things['world']['bgcolor'], (26,26,26))
def test_rendermode_validation(self):
s = configParser.MultiWorldParser("test/data/settings/settings_test_rendermode.py")
s.parse()
self.assertRaises(ValidationException,s.validate)
if __name__ == "__main__":
unittest.main()