add test for fetch_remaining
This commit is contained in:
pare
655a45e086
commit
d47f915bfb
S'han modificat 2 arxius amb 1893 adicions i 2 eliminacions
1881
tests/cassettes/test_fetch_remaining.yaml
Normal file
1881
tests/cassettes/test_fetch_remaining.yaml
Normal file
La diferencia del archivo ha sido suprimido porque es demasiado grande
Cargar Diff
|
@ -3,10 +3,10 @@ from contextlib import contextmanager
|
|||
|
||||
|
||||
@contextmanager
|
||||
def many_statuses(api, n=10):
|
||||
def many_statuses(api, n=10, suffix=''):
|
||||
statuses = list()
|
||||
for i in range(n):
|
||||
status = api.status_post("Toot number {}!".format(i))
|
||||
status = api.status_post("Toot number {}!{}".format(i, suffix))
|
||||
statuses.append(status)
|
||||
yield statuses
|
||||
for status in statuses:
|
||||
|
@ -22,3 +22,13 @@ def test_fetch_next_previous(api):
|
|||
assert next_statuses
|
||||
previous_statuses = api.fetch_previous(next_statuses)
|
||||
assert previous_statuses
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_fetch_remaining(api):
|
||||
UNLIKELY_HASHTAG = "fgiztsshwiaqqiztpmmjbtvmescsculuvmgjgopwoeidbcrixp"
|
||||
with many_statuses(api, n=30, suffix=' #'+UNLIKELY_HASHTAG):
|
||||
hashtag = api.timeline_hashtag(UNLIKELY_HASHTAG, limit=10)
|
||||
hashtag_remaining = api.fetch_remaining(hashtag)
|
||||
assert hashtag_remaining
|
||||
assert len(hashtag_remaining) >= 30
|
||||
|
|
Loading…
Referencia en una nova incidència