Example #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')
Example #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")
Example #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')
Example #4
0
def test_get_team__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Example #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
Example #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()
Example #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
Example #8
0
def test_get_key_store__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_key_store()
Example #9
0
def test_get_key_store__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_key_store()
Example #10
0
def test_get_team(fx_team):
    app.config['TEAM'] = fx_team
    with app.app_context():
        assert get_team() is fx_team
Example #11
0
def test_get_team__invalid_type():
    app.config['TEAM'] = 'invalid type'
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Example #12
0
def test_get_team__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Example #13
0
def test_get_team__invalid_type():
    app.config["TEAM"] = "invalid type"
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Example #14
0
def test_get_team__invalid_type():
    app.config['TEAM'] = 'invalid type'
    with raises(RuntimeError):
        with app.app_context():
            get_team()
Example #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()
Example #16
0
def test_get_team(fx_team):
    app.config['TEAM'] = fx_team
    with app.app_context():
        assert get_team() is fx_team
Example #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
Example #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()
Example #19
0
def test_get_remote_set__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_remote_set()
Example #20
0
def test_get_remote_set__no_config():
    with raises(RuntimeError):
        with app.app_context():
            get_remote_set()
Example #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()
Example #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
Example #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()