Пример #1
0
def setup_function():
    Account.clear_cache()
    Comment.clear_cache()
    Location.clear_cache()
    Media.clear_cache()
    Story.clear_cache()
    Tag.clear_cache()
Пример #2
0
def test_clear_cache_comment(id):
    account = Account("test")
    media = Media("test")
    comment = Comment(id, media=media, owner=account, text="test", created_at=0)
    assert Comment.cache == {id: comment}  

    Comment.clear_cache()
    assert Comment.cache == dict()
    assert Media.cache == {"test": media}
    assert Account.cache == {"test": account}
Пример #3
0
def test_comment(login, password, shortcode):
    agent = AgentAccount(login, password)
    media = Media(shortcode)

    comment = agent.add_comment(media, "test")
    agent.delete_comment(comment)

    Account.clear_cache()
    Media.clear_cache()
    Comment.clear_cache()
Пример #4
0
def test_clear_cache_comment():
    account = Account("test")
    media = Media("test")
    comment = Comment(1488, media=media, owner=account, text="test",
                      created_at=0)
    
    Media.clear_cache()
    Comment.clear_cache()
    
    assert(Comment._cache == dict())
    assert(Media._cache == dict())