Ejemplo n.º 1
0
def test_get_data_present(query_fn, testbed):
    memcache.add('key', 'data', 9000)
    data = snippets.get_data()
    query_fn.assert_not_called()
    if data != 'data':
        raise AssertionError
    memcache.delete('key')
def test_get_data_present(query_fn, testbed):
    memcache.add('key', 'data', 9000)
    data = snippets.get_data()
    query_fn.assert_not_called()
    assert data == 'data'
    memcache.delete('key')
def test_get_data_not_present(query_fn, testbed):
    data = snippets.get_data()
    query_fn.assert_called_once_with()
    assert data == 'data'
    memcache.delete('key')
Ejemplo n.º 4
0
def test_get_data_not_present(query_fn, testbed):
    data = snippets.get_data()
    query_fn.assert_called_once_with()
    if data != 'data':
        raise AssertionError
    memcache.delete('key')
def test_get_data_present(query_fn, testbed):
    memcache.add('key', 'data', 9000)
    data = snippets.get_data()
    query_fn.assert_not_called()
    assert data == 'data'
    memcache.delete('key')
def test_get_data_not_present(query_fn, testbed):
    data = snippets.get_data()
    query_fn.assert_called_once_with()
    assert data == 'data'
    memcache.delete('key')