Ejemplo n.º 1
0
    def test_decode_iter_request_timeline(self):

        timestamp = time.time()
        latest = timestamp - 1000
        data = {"has_more": True, "latest": timestamp, "messages": [{"ts": latest}]}
        next_ = sansio.decode_iter_request(data)
        assert next_ == latest
Ejemplo n.º 2
0
    def test_decode_iter_request_paging(self):

        data = {"paging": {"page": 2, "pages": 4}}
        page = sansio.decode_iter_request(data)
        assert page == 3
Ejemplo n.º 3
0
    def test_decode_iter_request_cursor(self):

        data = {"response_metadata": {"next_cursor": "abcdefg"}}
        cursor = sansio.decode_iter_request(data)
        assert cursor == "abcdefg"