Exemplo n.º 1
0
    def test_is_http_instance(self):
        client = BitmexWsClient(
            test=True,
            api_key=api_key,
            api_secret=api_secret,
        )

        assert issubclass(BitmexWsClient, WsClient)

        client.close()
Exemplo n.º 2
0
    def test_instance_by_api_key(self):
        client = BitmexWsClient(test=True,
                                api_key=api_key,
                                api_secret=api_secret)

        assert isinstance(client, BitmexWsClient)
        assert client.test is True
        assert client.api_key is api_key
        assert client.api_secret is api_secret

        client.close()
Exemplo n.º 3
0
    def test_connect(self, qtbot):
        client = BitmexWsClient(test=True,
                                api_key=api_key,
                                api_secret=api_secret)

        with qtbot.waitSignals([client.sig_message],
                               order="strict",
                               timeout=10000) as blocking:
            client.start()

        assert blocking.signal_triggered

        data = client.data()
        assert type(data) == str

        data = client.json()
        assert type(data) == dict
        assert 'info' in data
        assert 'version' in data
        assert 'timestamp' in data
        assert 'docs' in data
        assert 'limit' in data
        client.close()