Beispiel #1
0
def test_get_token(fx_token_store):
    app.config['TOKEN_STORE'] = fx_token_store
    with app.app_context():
        token_store = get_token_store()
        assert isinstance(token_store, BaseCache)
        token_store.add('abc', 123)
        assert fx_token_store.get('abc') == 123
        token_store.set('def', 456)
        assert fx_token_store.get('def') == 456
        token_store.inc('def')
        assert fx_token_store.get('def') == 457
        token_store.dec('abc')
        assert fx_token_store.get('abc') == 122
        token_store.delete('def')
        assert not fx_token_store.get('def')
Beispiel #2
0
def test_get_token(fx_token_store):
    app.config["TOKEN_STORE"] = fx_token_store
    with app.app_context():
        token_store = get_token_store()
        assert isinstance(token_store, BaseCache)
        token_store.add("abc", 123)
        assert fx_token_store.get("abc") == 123
        token_store.set("def", 456)
        assert fx_token_store.get("def") == 456
        token_store.inc("def")
        assert fx_token_store.get("def") == 457
        token_store.dec("abc")
        assert fx_token_store.get("abc") == 122
        token_store.delete("def")
        assert not fx_token_store.get("def")
Beispiel #3
0
def test_get_remote_set(fx_mock_remote_set):
    app.config['REMOTE_SET'] = fx_mock_remote_set
    with app.app_context():
        assert get_remote_set() == fx_mock_remote_set
Beispiel #4
0
def test_get_remote_set__invalid_type():
    app.config['REMOTE_SET'] = 'invalid type'
    with raises(RuntimeError):
        with app.app_context():
            get_remote_set()
Beispiel #5
0
def test_get_remote_set__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_remote_set()
Beispiel #6
0
def test_get_key_store(fx_key_store):
    app.config['KEY_STORE'] = fx_key_store
    with app.app_context():
        assert get_key_store() is fx_key_store
Beispiel #7
0
def test_get_key_store__invalid_type():
    app.config['KEY_STORE'] = 'invalid type'
    with raises(RuntimeError):
        with app.app_context():
            get_key_store()
Beispiel #8
0
def test_get_key_store__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_key_store()
Beispiel #9
0
def test_get_team(fx_team):
    app.config['TEAM'] = fx_team
    with app.app_context():
        assert get_team() is fx_team
Beispiel #10
0
def test_get_team__invalid_type():
    app.config['TEAM'] = 'invalid type'
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Beispiel #11
0
def test_get_team__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Beispiel #12
0
def test_get_team__invalid_type():
    app.config["TEAM"] = "invalid type"
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Beispiel #13
0
def test_get_token_store__invalid_type():
    app.config["TOKEN_STORE"] = "invalid type"
    with raises(RuntimeError):
        with app.app_context():
            get_token_store()