Showing 2 of 6 files from the diff.

@@ -4,7 +4,7 @@
Loading
4 4
from urllib.parse import urlencode
5 5
6 6
import requests
7 -
from requests.exceptions import HTTPError, RequestException
7 +
from requests.exceptions import RequestException
8 8
from w3lib.url import canonicalize_url
9 9
10 10
from django.conf import settings

@@ -128,7 +128,7 @@
Loading
128 128
    assert response_two.content == expected_data
129 129
    assert isinstance(response_two, helpers.CacheResponse)
130 130
131 -
    log = caplog.records()[-1]
131 +
    log = caplog.records[-1]
132 132
    assert log.levelname == 'ERROR'
133 133
    assert log.msg == helpers.MESSAGE_CACHE_HIT
134 134
    assert log.status_code == 400
@@ -146,7 +146,7 @@
Loading
146 146
    assert response.status_code == 400
147 147
    assert isinstance(response, helpers.FailureResponse)
148 148
149 -
    log = caplog.records()[-1]
149 +
    log = caplog.records[-1]
150 150
    assert log.levelname == 'ERROR'
151 151
    assert log.msg == helpers.MESSAGE_CACHE_MISS
152 152
    assert log.status_code == 400
@@ -164,7 +164,7 @@
Loading
164 164
    assert response.status_code == 404
165 165
    assert isinstance(response, helpers.LiveResponse)
166 166
167 -
    log = caplog.records()[-1]
167 +
    log = caplog.records[-1]
168 168
    assert log.levelname == 'ERROR'
169 169
    assert log.msg == helpers.MESSAGE_NOT_FOUND
170 170
    assert log.status_code == 404
@@ -192,7 +192,7 @@
Loading
192 192
    assert response_two.content == expected_data
193 193
    assert isinstance(response_two, helpers.CacheResponse)
194 194
195 -
    log = caplog.records()[-1]
195 +
    log = caplog.records[-1]
196 196
    assert log.levelname == 'ERROR'
197 197
    assert log.msg == helpers.MESSAGE_CACHE_HIT
198 198
    assert log.url == path
@@ -205,7 +205,7 @@
Loading
205 205
        with pytest.raises(requests.exceptions.ConnectionError):
206 206
            cached_client.retrieve('thing')
207 207
208 -
    assert len(caplog.records()) == 0
208 +
    assert len(caplog.records) == 0
209 209
210 210
211 211
def test_cache_querystrings(cached_client, fallback_cache):
@@ -234,7 +234,7 @@
Loading
234 234
        mock_get.side_effect = requests.exceptions.ConnectionError()
235 235
        cached_client.retrieve('thing')
236 236
237 -
    errors = [item for item in caplog.records() if item.levelname == 'ERROR']
237 +
    errors = [item for item in caplog.records if item.levelname == 'ERROR']
238 238
    assert len(errors) == 1
239 239
240 240
    with patch('directory_client_core.base.AbstractAPIClient.get') as mock_get:
@@ -242,7 +242,7 @@
Loading
242 242
        cached_client.retrieve('thing')
243 243
244 244
    # second log entry was filtered out
245 -
    errors = [item for item in caplog.records() if item.levelname == 'ERROR']
245 +
    errors = [item for item in caplog.records if item.levelname == 'ERROR']
246 246
    assert len(errors) == 1
247 247
248 248
Files Coverage
directory_client_core 97.62%
tests 100.00%
Project Totals (9 files) 99.09%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading