aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_utilities.py
diff options
context:
space:
mode:
authorGravatar Christopher Baklid <[email protected]>2018-05-20 21:11:18 +0200
committerGravatar GitHub <[email protected]>2018-05-20 21:11:18 +0200
commit687fedfffa402e049c59668f2a6248ad2ba17910 (patch)
tree834e909781213650b40508398ed5a9bef10686c5 /tests/test_utilities.py
parentremove 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.py25
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