def test_delete_from_cache_handles_missing_key():
    """Test ``delete_from_cache`` handles missing key being deleted.

    Tests that :py:meth:`~.RallyAccessor.delete_from_cache` does not raise an
    exception when a key is deleted that doesn't exist.
    """
    MEM_CACHE.clear()
    my_accessor = RallyAccessor('uname', 'pword', 'base_url')

    my_accessor.delete_from_cache('story', 'key')

    assert_equal(MEM_CACHE, {'story': {}})
Exemple #2
0
def test_delete_from_cache_handles_missing_key():
    """Test ``delete_from_cache`` handles missing key being deleted.

    Tests that :py:meth:`~.RallyAccessor.delete_from_cache` does not raise an
    exception when a key is deleted that doesn't exist.
    """
    MEM_CACHE.clear()
    my_accessor = RallyAccessor('uname', 'pword', 'base_url')

    my_accessor.delete_from_cache('story', 'key')

    assert_equal(MEM_CACHE, {'story': {}})
def test_delete_from_cache_removes_correctly():
    """Test ``delete_from_cache`` removes the correct key from the cache.

    Tests :py:meth:`~.RallyAccessor.delete_from_cache`.
    """
    MEM_CACHE.clear()
    my_accessor = RallyAccessor('uname', 'pword', 'base_url')
    MEM_CACHE['cache_key']['cache_lookup'] = 'some_test_data'

    my_accessor.delete_from_cache('cache_key', 'cache_lookup')

    assert_equal(MEM_CACHE, {'cache_key': {}})
Exemple #4
0
def test_delete_from_cache_removes_correctly():
    """Test ``delete_from_cache`` removes the correct key from the cache.

    Tests :py:meth:`~.RallyAccessor.delete_from_cache`.
    """
    MEM_CACHE.clear()
    my_accessor = RallyAccessor('uname', 'pword', 'base_url')
    MEM_CACHE['cache_key']['cache_lookup'] = 'some_test_data'

    my_accessor.delete_from_cache('cache_key', 'cache_lookup')

    assert_equal(MEM_CACHE, {'cache_key': {}})