|
| 1 | +from .base_config_test import BaseConfigTest, CollsDirMixin, fmod |
1 | 2 |
|
2 | 3 | from io import BytesIO
|
3 | 4 | import os
|
4 | 5 |
|
5 | 6 | from warcio import WARCWriter, StatusAndHeaders
|
6 | 7 | from pywb.manager.manager import main as wb_manager
|
7 | 8 |
|
8 |
| -from .base_config_test import BaseConfigTest, CollsDirMixin, fmod |
9 |
| - |
10 | 9 |
|
11 | 10 | # ============================================================================
|
12 | 11 | class TestRevisits(CollsDirMixin, BaseConfigTest):
|
@@ -125,18 +124,22 @@ def test_different_url_revisit_orig_headers(self, fmod):
|
125 | 124 | res = self.get('/revisits/20220101{0}/http://example.com/', fmod, status=301)
|
126 | 125 | assert res.headers["Custom"] == "4"
|
127 | 126 | assert res.headers["Location"].endswith("/20220101{0}/https://example.com/redirect-4".format(fmod))
|
128 |
| - assert res.text == 'some\ntext' |
| 127 | + assert res.content_length == 0 |
| 128 | + assert res.text == '' |
129 | 129 |
|
130 |
| - def test_different_url_revisit_and_response(self, fmod): |
| 130 | + def test_different_url_response_and_revisit(self, fmod): |
| 131 | + # response |
131 | 132 | res = self.get('/revisits/20200101{0}/http://example.com/orig-2', fmod, status=301)
|
132 | 133 | assert res.headers["Custom"] == "2"
|
133 | 134 | assert res.headers["Location"].endswith("/20200101{0}/https://example.com/redirect-2".format(fmod))
|
134 | 135 | assert res.text == 'some\ntext'
|
135 | 136 |
|
| 137 | + # revisit |
136 | 138 | res = self.get('/revisits/20220101{0}/http://example.com/orig-2', fmod, status=301)
|
137 | 139 | assert res.headers["Custom"] == "3"
|
138 | 140 | assert res.headers["Location"].endswith("/20220101{0}/https://example.com/redirect-3".format(fmod))
|
139 |
| - assert res.text == 'some\ntext' |
| 141 | + assert res.content_length == 0 |
| 142 | + assert res.text == '' |
140 | 143 |
|
141 | 144 | def test_orig(self, fmod):
|
142 | 145 | res = self.get('/revisits/20200101{0}/http://example.com/orig-1', fmod, status=301)
|
|
0 commit comments