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