summaryrefslogtreecommitdiffstats
path: root/tests/api/test_WebSocketBackend.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-02 18:11:31 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-02 18:11:31 +0100
commit6b20f5f6c063e4e6c94d719b607ad5a028b8beee (patch)
treea8c3dfa9962aa819507870553700a35b7dcc4c74 /tests/api/test_WebSocketBackend.py
parentRemove '/' from filename to avoid filepath exception (diff)
downloadpyload-6b20f5f6c063e4e6c94d719b607ad5a028b8beee.tar.xz
new configManager for multi user configs
Diffstat (limited to 'tests/api/test_WebSocketBackend.py')
-rw-r--r--tests/api/test_WebSocketBackend.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/api/test_WebSocketBackend.py b/tests/api/test_WebSocketBackend.py
new file mode 100644
index 000000000..be465e3d4
--- /dev/null
+++ b/tests/api/test_WebSocketBackend.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+
+from nose.tools import raises
+
+from module.remote.ttypes import Forbidden
+from module.remote.WSClient import WSClient
+
+class TestWebSocketBackend:
+
+ def setUp(self):
+ self.client = WSClient()
+ self.client.connect()
+
+ def tearDown(self):
+ self.client.close()
+
+ def test_login(self):
+ self.client.login("User", "test")
+ self.client.getServerVersion()
+ self.client.logout()
+
+ def test_wronglogin(self):
+ ret = self.client.login("WrongUser", "wrongpw")
+ assert ret == False
+
+ @raises(Forbidden)
+ def test_access(self):
+ self.client.getServerVersion()
+
+ @raises(AttributeError)
+ def test_unknown_method(self):
+ self.client.login("User", "test")
+ self.client.sdfdsg()