Пример #1
0
def test_get_media_tag_long(login, password, count, name):
    agent = AgentAccount(login, password)
    tag = Tag(name)

    data, pointer = agent.get_media(tag, count=count)

    assert (min(tag.media_count, count) == len(data))
    assert ((pointer is None) == (tag.media_count <= count))

    Tag.clear_cache()
    Media.clear_cache()
Пример #2
0
def test_get_media_location_long(login, password, count, id):
    agent = AgentAccount(login, password)
    location = Location(id)

    data, pointer = agent.get_media(location, count=count)

    assert (min(location.media_count, count) == len(data))
    assert ((pointer is None) == (location.media_count <= count))

    Location.clear_cache()
    Media.clear_cache()
Пример #3
0
def test_get_media_account_long(login, password, count, username):
    agent = AgentAccount(login, password)
    account = Account(username)

    data, pointer = agent.get_media(account, count=count)

    assert (min(account.media_count, count) == len(data))
    assert ((pointer is None) == (account.media_count <= count))

    Account.clear_cache()
    Media.clear_cache()
Пример #4
0
def test_get_media_account_pointer(login, password, count, username):
    agent = AgentAccount(login, password)
    account = Account(username)
    pointer = None
    data = []

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

    assert ((pointer is None) == (account.media_count <= count))

    Account.clear_cache()
    Media.clear_cache()
Пример #5
0
def test_get_media_tag_pointer(login, password, count, name):
    agent = AgentAccount(login, password)
    tag = Tag(name)
    pointer = None
    data = []

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

    assert ((pointer is None) == (tag.media_count <= count))

    Account.clear_cache()
    Media.clear_cache()
    Tag.clear_cache()
Пример #6
0
def test_get_media_location_pointer(login, password, count, id):
    agent = AgentAccount(login, password)
    location = Location(id)
    pointer = None
    data = []

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

    assert ((pointer is None) == (location.media_count <= count))

    Account.clear_cache()
    Media.clear_cache()
    Location.clear_cache()