def test_purge_cache_key(self): mocked_session = create_mocked_session() client = Azion(session=mocked_session) # URLs to be purged urls = ['www.domain.com/', 'www.domain.com/test.js'] client.purge_cache_key(urls, 'delete') mocked_session.post.assert_called_once_with( 'https://api.azion.net/purge/cachekey', json={ 'urls': urls, 'method': 'delete' })
def test_purge_cache_key(self): client = Azion(token) recorder = betamax.Betamax(client.session) urls = [ 'www.maugzoide.com/@@cookie_name=foobar', 'www.maugzoide.com/profile.jpg@@' ] with recorder.use_cassette('Purge_cachekey'): assert client.purge_cache_key(urls)