diff options
| author | 2018-05-20 21:11:18 +0200 | |
|---|---|---|
| committer | 2018-05-20 21:11:18 +0200 | |
| commit | 687fedfffa402e049c59668f2a6248ad2ba17910 (patch) | |
| tree | 834e909781213650b40508398ed5a9bef10686c5 /tests/test_utilities.py | |
| parent | remove set -e (diff) | |
Tests directory (#73)
moves all tests into a testing directory and splits the tests into separate files
Diffstat (limited to 'tests/test_utilities.py')
| -rw-r--r-- | tests/test_utilities.py | 25 | 
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_utilities.py b/tests/test_utilities.py new file mode 100644 index 00000000..61a480e2 --- /dev/null +++ b/tests/test_utilities.py @@ -0,0 +1,25 @@ +from tests import SiteTest, manager + +class Utilities(SiteTest): +    """ Test cases for internal utility code """ +    def test_error_view_runtime_error(self): +        """ Check that wrong values for error view setup raises runtime error """ +        import pysite.base_route + +        ev = pysite.base_route.ErrorView() + +        with self.assertRaises(RuntimeError): +            ev.setup(manager, 'sdfsdf') + +    def test_websocket_callback(self): +        """ Check that websocket default callbacks work """ +        import pysite.websockets + +        class TestWS(pysite.websockets.WS): +            pass + +        try: +            TestWS(None).on_message("test") +            return False +        except NotImplementedError: +            return True  |