class TestWebSocketBackend:

    def setUp(self):
        self.client = WSClient(wsAddress)
        self.client.connect()

    def tearDown(self):
        self.client.close()

    def test_login(self):
        self.client.login(*credentials)
        self.client.getServerVersion()
        self.client.logout()

    def test_wronglogin(self):
        ret = self.client.login("WrongUser", "wrongpw")
        assert ret is False

    @raises(Forbidden)
    def test_access(self):
        self.client.getServerVersion()

    @raises(AttributeError)
    def test_unknown_method(self):
        self.client.login(*credentials)
        self.client.sdfdsg()
 def setUp(self):
     self.client = WSClient(wsAddress)
     self.client.connect()
Beispiel #3
0
 def setUp(self):
     self.client = WSClient()
     self.client.connect()
Beispiel #4
0
 def setUp(self):
     self.client = WSClient(wsAddress)
     self.client.connect()
Beispiel #5
0
class TestWebSocketBackend:
    def setUp(self):
        self.client = WSClient(wsAddress)
        self.client.connect()

    def tearDown(self):
        self.client.close()

    def test_login(self):
        self.client.login(*credentials)
        self.client.getServerVersion()
        self.client.logout()

    def test_wronglogin(self):
        ret = self.client.login("WrongUser", "wrongpw")
        assert ret is False

    @raises(Forbidden)
    def test_access(self):
        self.client.getServerVersion()

    @raises(AttributeError)
    def test_unknown_method(self):
        self.client.login(*credentials)
        self.client.sdfdsg()
Beispiel #6
0
 def enableWS(self):
     self.api = ApiProxy(WSClient(wsAddress))