Skip to content
Myr

Update on Tracking Previous Requests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Modified the comment in sessions.py and rewrote the test in test_requests.py

authored by ContinuousFunction · committed by ContinuousFunction · parent df641e7 · Browse files · 2 files+5 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+5 added−4 removed

  • other:+5 added−4 removed

2 files+5 added−4 removed

modified:requests/sessions.py+1 added-1 removed
95 unmodified lines
96 while resp.is_redirect:97 prepared_request = req.copy()9899 if i > 0:100 #create deep copy of the history and keep track of redirects100 #update history and keep track of redirects101 hist.append(resp)102 new_hist = list(hist)103 resp.history = new_hist104
548 unmodified lines
modified:test_requests.py+4 added-3 removed
974 unmodified lines
975 assert s == "Basic dGVzdDp0ZXN0"976977 def test_requests_history_is_saved(self):978 r = requests.get('https://httpbin.org/redirect/5')979 count = 0979 total = r.history[-1].history980 i = 0981 for item in r.history:981 assert len(item.history) == count982 count = count + 1982 assert item.history == total[0:i]983 i=i+1984985986class TestContentEncodingDetection(unittest.TestCase):987
447 unmodified lines