Пример #1
0
def test_get_likes_long(login, password, count, shortcode):
    agent = AgentAccount(login, password)
    media = Media(shortcode)

    data, pointer = agent.get_likes(media, count=count)

    assert (min(media.likes_count, count) == len(data))
    assert ((pointer is None) == (media.likes_count <= count))

    Media.clear_cache()
Пример #2
0
def test_get_likes_pointer(login, password, count, shortcode):
    agent = AgentAccount(login, password)
    media = Media(username)
    pointer = None
    data = []

    for i in range(count):
        tmp, pointer = agent.get_likes(media, pointer=pointer)
        data.extend(tmp)

    assert ((pointer is None) == (media.likes_count <= count))

    Account.clear_cache()
    Media.clear_cache()