File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -127,4 +127,6 @@ Contributors
127
127
128
128
- Matthew Krueger (@mlkrueger1987)
129
129
130
- - Dejan Svetec (@dsvetec)
130
+ - Dejan Svetec (@dsvetec)
131
+
132
+ - Billy Keyes (@bluekeyes)
Original file line number Diff line number Diff line change @@ -285,6 +285,7 @@ def refresh(self, conditional=False):
285
285
headers = headers or None
286
286
json = self ._json (self ._get (self ._api , headers = headers ), 200 )
287
287
if json is not None :
288
+ self ._json_data = json
288
289
self ._update_attributes (json )
289
290
return self
290
291
Original file line number Diff line number Diff line change 1
1
import io
2
+ import json
2
3
import pytest
3
4
import requests
4
5
@@ -184,6 +185,21 @@ def test_refresh_etag(self):
184
185
headers = expected_headers ,
185
186
)
186
187
188
+ def test_refresh_json (self ):
189
+ """Verify refreshing an object updates stored json data."""
190
+ expected_data = {
191
+ 'changed_files' : 4
192
+ }
193
+ response = requests .Response ()
194
+ response .status_code = 200
195
+ response .raw = io .BytesIO (json .dumps (expected_data ).encode ('utf8' ))
196
+ self .session .get .return_value = response
197
+
198
+ self .instance .refresh ()
199
+
200
+ assert 'changed_files' in self .instance .as_dict ()
201
+ assert self .instance .changed_files == 4
202
+
187
203
def test_strptime (self ):
188
204
"""Verify that method converts ISO 8601 formatted string."""
189
205
dt = self .instance ._strptime ('2015-06-18T19:53:04Z' )
You can’t perform that action at this time.
0 commit comments