Exemplo n.º 1
0
def test_init_throws(cache, dbexists):
    dbexists.return_value = False
    tiles._sqcache = None
    with pytest.raises(Exception):
        tiles.init()
    with pytest.raises(Exception):
        tiles._get_cache()
Exemplo n.º 2
0
def test_init(cache, dbexists):
    tiles._sqcache = None
    tiles.init()

    assert( dbexists.called )
    name = dbexists.call_args[0][0]
    cache.assert_called_with(name)