Start of some unit tests for setting.py parsing
This commit is contained in:
24
test/test_settings.py
Normal file
24
test/test_settings.py
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
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()
|
||||
Reference in New Issue
Block a user