diff options
Diffstat (limited to 'tests/api/test_JSONBackend.py')
-rw-r--r-- | tests/api/test_JSONBackend.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/api/test_JSONBackend.py b/tests/api/test_JSONBackend.py new file mode 100644 index 000000000..b6509a52a --- /dev/null +++ b/tests/api/test_JSONBackend.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +from nose.tools import raises + +from module.remote.apitypes import Forbidden +from module.remote.JSONClient import JSONClient + +class TestJSONBackend: + + def setUp(self): + self.client = JSONClient() + + 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() + + # TODO: test raising of exceptions, also in WSBackend
\ No newline at end of file |