def test_store_token(): ocn_auth = OceanAuth(":memory:") wallet = get_publisher_wallet() token = ocn_auth.store(wallet) assert ocn_auth.check(token) == wallet.address, "invalid token, check failed." # verify it is saved assert ocn_auth.restore(wallet) == token, "Restoring token failed."
def test_restore_token(): ocn_auth = OceanAuth(':memory:') wallet = get_publisher_wallet() assert ocn_auth.restore( wallet) is None, 'Expecting None when restoring non-existing token.' token = ocn_auth.store(wallet) assert ocn_auth.check( token) == wallet.address, 'invalid token, check failed.' # verify it is saved assert ocn_auth.restore(wallet) == token, 'Restoring token failed.'
def test_restore_token(): ocn_auth = OceanAuth(":memory:") wallet = get_publisher_wallet() assert ( ocn_auth.restore(wallet) is None ), "Expecting None when restoring non-existing token." token = ocn_auth.store(wallet) assert ocn_auth.check(token) == wallet.address, "invalid token, check failed." # verify it is saved assert ocn_auth.restore(wallet) == token, "Restoring token failed."