Ejemplo n.º 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')
Ejemplo n.º 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")
Ejemplo n.º 3
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')
Ejemplo n.º 4
0
def test_get_team__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Ejemplo n.º 5
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
Ejemplo n.º 6
0
def test_get_remote_set__invalid_type():
    app.config['REMOTE_SET'] = 'invalid type'
    with raises(RuntimeError):
        with app.app_context():
            get_remote_set()
Ejemplo n.º 7
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
Ejemplo n.º 8
0
def test_get_key_store__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_key_store()
Ejemplo n.º 9
0
def test_get_key_store__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_key_store()
Ejemplo n.º 10
0
def test_get_team(fx_team):
    app.config['TEAM'] = fx_team
    with app.app_context():
        assert get_team() is fx_team
Ejemplo n.º 11
0
def test_get_team__invalid_type():
    app.config['TEAM'] = 'invalid type'
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Ejemplo n.º 12
0
def test_get_team__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Ejemplo n.º 13
0
def test_get_team__invalid_type():
    app.config["TEAM"] = "invalid type"
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Ejemplo n.º 14
0
def test_get_team__invalid_type():
    app.config['TEAM'] = 'invalid type'
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Ejemplo n.º 15
0
def test_get_key_store__invalid_type():
    app.config['KEY_STORE'] = 'invalid type'
    with raises(RuntimeError):
        with app.app_context():
            get_key_store()
Ejemplo n.º 16
0
def test_get_team(fx_team):
    app.config['TEAM'] = fx_team
    with app.app_context():
        assert get_team() is fx_team
Ejemplo n.º 17
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
Ejemplo n.º 18
0
def test_get_key_store__invalid_type():
    app.config['KEY_STORE'] = 'invalid type'
    with raises(RuntimeError):
        with app.app_context():
            get_key_store()
Ejemplo n.º 19
0
def test_get_remote_set__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_remote_set()
Ejemplo n.º 20
0
def test_get_remote_set__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_remote_set()
Ejemplo n.º 21
0
def test_get_remote_set__invalid_type():
    app.config['REMOTE_SET'] = 'invalid type'
    with raises(RuntimeError):
        with app.app_context():
            get_remote_set()
Ejemplo n.º 22
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
Ejemplo n.º 23
0
def test_get_token_store__invalid_type():
    app.config["TOKEN_STORE"] = "invalid type"
    with raises(RuntimeError):
        with app.app_context():
            get_token_store()