示例#1
0
def test_storages():
    app = Kutana()

    app.set_storage('permanent', MemoryStorage())

    assert app.get_storage('default')
    assert app.get_storage('permanent')
    assert not app.get_storage('temporary')
示例#2
0
def test_incorrect_values():
    app = Kutana()

    with pytest.raises(ValueError):
        app.add_backend(None)

    with pytest.raises(ValueError):
        app.set_storage('permanent', None)

    with pytest.raises(ValueError):
        app.add_plugin(None)