MCPcopy Create free account
hub / github.com/requests-cache/requests-cache / test_allowable_codes

Function test_allowable_codes

tests/unit/test_session.py:629–640  ·  view source on GitHub ↗
(mock_session)

Source from the content-addressed store, hash-verified

627
628
629def test_allowable_codes(mock_session):
630 mock_session.settings.allowable_codes = (200, 404)
631
632 # This request should be cached
633 mock_session.get(MOCKED_URL_404)
634 assert mock_session.cache.contains(url=MOCKED_URL_404)
635 assert mock_session.get(MOCKED_URL_404).from_cache is True
636
637 # This request should be filtered out on both read and write
638 mock_session.get(MOCKED_URL_500)
639 assert not mock_session.cache.contains(url=MOCKED_URL_500)
640 assert mock_session.get(MOCKED_URL_500).from_cache is False
641
642
643def test_allowable_methods(mock_session):

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
containsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…