Пример #1
0
def test_get_by_alias_with_ttl():
    alias = make_alias(False)
    store = AliasStore(60)
    store.save(alias)
    assert store.get_by_alias(alias.public_alias) == alias
    assert AliasStore().get_by_alias(alias.public_alias) is None
Пример #2
0
def test_get_by_alias_with_ttl_expired():
    alias = make_alias(False)
    store = AliasStore(-1)
    store.save(alias)
    assert store.get_by_alias(alias.public_alias) is None
Пример #3
0
def test_get_by_alias():
    alias = make_alias(True)
    store = AliasStore()
    assert store.get_by_alias(alias.value) is None
    assert store.get_by_alias(alias.public_alias) == alias