acf9d6214e
Put tests into directory structure equivalent to that of the code itself, for better separation (hopefully)
23 lines
933 B
Python
23 lines
933 B
Python
import unittest
|
|
|
|
import core.module
|
|
|
|
class module(unittest.TestCase):
|
|
def setUp(self):
|
|
self._invalidModuleName = 'invalid-module-name'
|
|
self._validModuleName = 'test'
|
|
|
|
def tearDown(self):
|
|
pass
|
|
|
|
def test_load_invalid_module(self):
|
|
module = core.module.load(self._invalidModuleName)
|
|
self.assertEqual('core.module', module.__class__.__module__, 'module must be a module object')
|
|
self.assertEqual('Error', module.__class__.__name__, 'an invalid module must be a core.module.Error')
|
|
|
|
def test_load_valid_module(self):
|
|
module = core.module.load(self._validModuleName)
|
|
self.assertEqual('modules.{}'.format(self._validModuleName), module.__class__.__module__, 'module must be a modules.<name> object')
|
|
self.assertEqual('Module', module.__class__.__name__, 'a valid module must have a Module class')
|
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|