Initial Python 3 port
Many things work, some don't. Notably, genPOI doesn't work, and there's some signedness comparison stuff going on in the C extension. This also completely drops support for Python 2, as maintaining a C extension for both Python 2 and 3 is a pain and not worth it for the 9 months that Python 2 is still going to be supported upstream. The documentation needs to be adjusted as well. All of the few tests we have pass, and rendering a map works, both with a configuration file and without. We can also use optimizeimages. Concerns #1528.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import unittest
|
||||
from collections import OrderedDict
|
||||
|
||||
from overviewer_core import configParser
|
||||
from overviewer_core.settingsValidators import ValidationException
|
||||
@@ -6,7 +7,6 @@ from overviewer_core.settingsValidators import ValidationException
|
||||
from overviewer_core import world
|
||||
from overviewer_core import rendermodes
|
||||
|
||||
from overviewer_core.util import OrderedDict
|
||||
|
||||
class SettingsTest(unittest.TestCase):
|
||||
|
||||
@@ -23,12 +23,12 @@ class SettingsTest(unittest.TestCase):
|
||||
# no exceptions so far. that's a good thing
|
||||
|
||||
# Test the default
|
||||
self.assertEquals(things['renders']['myworld']['bgcolor'], (26,26,26,0))
|
||||
self.assertEqual(things['renders']['myworld']['bgcolor'], (26,26,26,0))
|
||||
|
||||
# Test a non-default
|
||||
self.assertEquals(things['renders']['otherworld']['bgcolor'], (255,255,255,0))
|
||||
self.assertEqual(things['renders']['otherworld']['bgcolor'], (255,255,255,0))
|
||||
|
||||
self.assertEquals(things['renders']['myworld']['northdirection'],
|
||||
self.assertEqual(things['renders']['myworld']['northdirection'],
|
||||
world.UPPER_LEFT)
|
||||
|
||||
def test_rendermode_validation(self):
|
||||
@@ -63,7 +63,7 @@ class SettingsTest(unittest.TestCase):
|
||||
}),
|
||||
]))
|
||||
self.s.set_config_item("outputdir", "/tmp/fictional/outputdir")
|
||||
self.assertEquals(fromfile.get_validated_config(), self.s.get_validated_config())
|
||||
self.assertEqual(fromfile.get_validated_config(), self.s.get_validated_config())
|
||||
|
||||
def test_rendermode_string(self):
|
||||
self.s.set_config_item("worlds", {
|
||||
@@ -79,7 +79,7 @@ class SettingsTest(unittest.TestCase):
|
||||
},
|
||||
})
|
||||
p = self.s.get_validated_config()
|
||||
self.assertEquals(p['renders']['myworld']['rendermode'], rendermodes.normal)
|
||||
self.assertEqual(p['renders']['myworld']['rendermode'], rendermodes.normal)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user