예제 #1
0
    def test_stream_response_contains_metadata(self, client: StreamChat):
        resp = client.get_app_settings()

        assert len(resp.headers()) > 0
        assert resp.status_code() == 200

        rate_limit = resp.rate_limit()
        assert rate_limit.limit > 0
        assert rate_limit.remaining > 0
        assert type(rate_limit.reset) is datetime
예제 #2
0
    def test_stream_response(self, client: StreamChat):
        resp = client.get_app_settings()

        dumped = json.dumps(resp)
        assert '{"app":' in dumped
        assert "rate_limit" not in dumped
        assert "headers" not in dumped
        assert "status_code" not in dumped

        assert len(resp.headers()) > 0
        assert resp.status_code() == 200

        rate_limit = resp.rate_limit()
        assert rate_limit.limit > 0
        assert rate_limit.remaining > 0
        assert type(rate_limit.reset) is datetime
예제 #3
0
    def test_stream_response_can_serialize(self, client: StreamChat):
        resp = client.get_app_settings()

        assert len(resp) == 2
        del resp["duration"]
        assert '{"app":' in json.dumps(resp)
예제 #4
0
 def test_get_app_settings(self, client: StreamChat):
     configs = client.get_app_settings()
     assert "app" in configs