Attempting to integrate a basic test suite
This commit is contained in:
18
src/run_tests.py
Normal file
18
src/run_tests.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import unittest
|
||||
|
||||
testmodules = ["test.test_renderers", "test.test_setup_py2exe"]
|
||||
|
||||
suite = unittest.TestSuite()
|
||||
|
||||
for t in testmodules:
|
||||
try:
|
||||
# If the module defines a suite() function, call it to get the suite.
|
||||
mod = __import__(t, globals(), locals(), ['suite'])
|
||||
suitefn = getattr(mod, 'suite')
|
||||
suite.addTest(suitefn())
|
||||
except (ImportError, AttributeError):
|
||||
# else, just load all the test cases from the module.
|
||||
suite.addTest(unittest.defaultTestLoader.loadTestsFromName(t))
|
||||
|
||||
unittest.TextTestRunner(verbosity=2).run(suite)
|
17
src/test/test_setup_py2exe.py
Normal file
17
src/test/test_setup_py2exe.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import sys
|
||||
import unittest
|
||||
import application
|
||||
|
||||
class py2exeTestCase(unittest.TestCase):
|
||||
|
||||
@unittest.skipUnless(sys.version[0] == "2", "this only fails under Python 2")
|
||||
def test_application_not_unicode(self):
|
||||
""" Testing if some strings present in application have not changed to unicode. """
|
||||
self.assertIsInstance(application.name, str)
|
||||
self.assertIsInstance(application.author, str)
|
||||
self.assertIsInstance(application.authorEmail, str)
|
||||
self.assertIsInstance(application.version, str)
|
||||
self.assertIsInstance(application.url, str)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
Reference in New Issue
Block a user