23
23
'ia' : MementoIndexSource .from_timegate_url ('http://web.archive.org/web/' ),
24
24
'ait' : MementoIndexSource .from_timegate_url ('http://wayback.archive-it.org/all/' ),
25
25
'bl' : MementoIndexSource .from_timegate_url ('http://www.webarchive.org.uk/wayback/archive/' ),
26
- 'rhiz' : MementoIndexSource .from_timegate_url ('https://webenact .rhizome.org/vvork/' , path = '*' )
26
+ 'rhiz' : MementoIndexSource .from_timegate_url ('https://webarchives .rhizome.org/vvork/' , path = '*' )
27
27
}
28
28
29
29
aggs = {'simple' : SimpleAggregator (sources ),
@@ -59,7 +59,7 @@ def test_mem_agg_index_1(self, agg):
59
59
60
60
assert (to_json_list (res ) == exp )
61
61
assert (errs == {'bl' : "NotFoundException('http://www.webarchive.org.uk/wayback/archive/http://iana.org/',)" ,
62
- 'rhiz' : "NotFoundException('https://webenact .rhizome.org/vvork/http://iana.org/',)" })
62
+ 'rhiz' : "NotFoundException('https://webarchives .rhizome.org/vvork/http://iana.org/',)" })
63
63
64
64
65
65
@pytest .mark .parametrize ("agg" , list (aggs .values ()), ids = list (aggs .keys ()))
@@ -77,7 +77,7 @@ def test_mem_agg_index_2(self, agg):
77
77
]
78
78
79
79
assert (to_json_list (res ) == exp )
80
- assert (errs == {'rhiz' : "NotFoundException('https://webenact .rhizome.org/vvork/http://example.com/',)" })
80
+ assert (errs == {'rhiz' : "NotFoundException('https://webarchives .rhizome.org/vvork/http://example.com/',)" })
81
81
82
82
83
83
@pytest .mark .parametrize ("agg" , list (aggs .values ()), ids = list (aggs .keys ()))
@@ -86,11 +86,13 @@ def test_mem_agg_index_3(self, agg):
86
86
url = 'http://vvork.com/'
87
87
res , errs = agg (dict (url = url , closest = '20141001' , limit = 5 ))
88
88
89
- exp = [{"timestamp" : "20141006184357" , "load_url" : "https://webenact.rhizome.org/vvork/20141006184357id_/http://www.vvork.com/" , "source" : "rhiz" },
89
+ exp = [
90
+ {"timestamp" : "20141006184357" , "load_url" : "https://webarchives.rhizome.org/vvork/20141006184357id_/http://www.vvork.com/" , "source" : "rhiz" },
90
91
{"timestamp" : "20141018133107" , "load_url" : "http://web.archive.org/web/20141018133107id_/http://vvork.com/" , "source" : "ia" },
91
92
{"timestamp" : "20141020161243" , "load_url" : "http://web.archive.org/web/20141020161243id_/http://vvork.com/" , "source" : "ia" },
92
93
{"timestamp" : "20140806161228" , "load_url" : "http://web.archive.org/web/20140806161228id_/http://vvork.com/" , "source" : "ia" },
93
- {"timestamp" : "20131004231540" , "load_url" : "http://wayback.archive-it.org/all/20131004231540id_/http://vvork.com/" , "source" : "ait" }]
94
+ {"timestamp" : "20131004231540" , "load_url" : "http://wayback.archive-it.org/all/20131004231540id_/http://vvork.com/" , "source" : "ait" },
95
+ ]
94
96
95
97
assert (to_json_list (res ) == exp )
96
98
assert (errs == {})
@@ -102,8 +104,10 @@ def test_mem_agg_index_4(self, agg):
102
104
url = 'http://vvork.com/'
103
105
res , errs = agg (dict (url = url , closest = '20141001' , limit = 2 , sources = 'rhiz,ait' ))
104
106
105
- exp = [{"timestamp" : "20141006184357" , "load_url" : "https://webenact.rhizome.org/vvork/20141006184357id_/http://www.vvork.com/" , "source" : "rhiz" },
106
- {"timestamp" : "20131004231540" , "load_url" : "http://wayback.archive-it.org/all/20131004231540id_/http://vvork.com/" , "source" : "ait" }]
107
+ exp = [
108
+ {"timestamp" : "20141006184357" , "load_url" : "https://webarchives.rhizome.org/vvork/20141006184357id_/http://www.vvork.com/" , "source" : "rhiz" },
109
+ {"timestamp" : "20131004231540" , "load_url" : "http://wayback.archive-it.org/all/20131004231540id_/http://vvork.com/" , "source" : "ait" },
110
+ ]
107
111
108
112
assert (to_json_list (res ) == exp )
109
113
assert (errs == {})
@@ -167,7 +171,7 @@ def _test_handler_output_cdxj(self):
167
171
headers , res , errs = handler (dict (url = url , closest = '20141001' , limit = 2 , sources = 'rhiz,ait' ))
168
172
169
173
exp = b"""\
170
- com,vvork)/ 20141006184357 {"url": "http://www.vvork.com/", "mem_rel": "memento", "memento_url": "https://webenact .rhizome.org/vvork/20141006184357/http://www.vvork.com/", "load_url": "https://webenact .rhizome.org/vvork/20141006184357id_/http://www.vvork.com/", "source": "rhiz"}
174
+ com,vvork)/ 20141006184357 {"url": "http://www.vvork.com/", "mem_rel": "memento", "memento_url": "https://webarchives .rhizome.org/vvork/20141006184357/http://www.vvork.com/", "load_url": "https://webarchives .rhizome.org/vvork/20141006184357id_/http://www.vvork.com/", "source": "rhiz"}
171
175
com,vvork)/ 20131004231540 {"url": "http://vvork.com/", "mem_rel": "last memento", "memento_url": "http://wayback.archive-it.org/all/20131004231540/http://vvork.com/", "load_url": "http://wayback.archive-it.org/all/20131004231540id_/http://vvork.com/", "source": "ait"}
172
176
"""
173
177
@@ -183,7 +187,7 @@ def _test_handler_output_json(self):
183
187
headers , res , errs = handler (dict (url = url , closest = '20141001' , limit = 2 , sources = 'rhiz,ait' , output = 'json' ))
184
188
185
189
exp = b"""\
186
- {"urlkey": "com,vvork)/", "timestamp": "20141006184357", "url": "http://www.vvork.com/", "mem_rel": "memento", "memento_url": "https://webenact .rhizome.org/vvork/20141006184357/http://www.vvork.com/", "load_url": "https://webenact .rhizome.org/vvork/20141006184357id_/http://www.vvork.com/", "source": "rhiz"}
190
+ {"urlkey": "com,vvork)/", "timestamp": "20141006184357", "url": "http://www.vvork.com/", "mem_rel": "memento", "memento_url": "https://webarchives .rhizome.org/vvork/20141006184357/http://www.vvork.com/", "load_url": "https://webarchives .rhizome.org/vvork/20141006184357id_/http://www.vvork.com/", "source": "rhiz"}
187
191
{"urlkey": "com,vvork)/", "timestamp": "20131004231540", "url": "http://vvork.com/", "mem_rel": "last memento", "memento_url": "http://wayback.archive-it.org/all/20131004231540/http://vvork.com/", "load_url": "http://wayback.archive-it.org/all/20131004231540id_/http://vvork.com/", "source": "ait"}
188
192
"""
189
193
@@ -198,7 +202,7 @@ def _test_handler_output_link(self):
198
202
headers , res , errs = handler (dict (url = url , closest = '20141001' , limit = 2 , sources = 'rhiz,ait' , output = 'link' ))
199
203
200
204
exp = b"""\
201
- <https://webenact .rhizome.org/vvork/20141006184357id_/http://www.vvork.com/>; rel="memento"; datetime="Mon, 06 Oct 2014 18:43:57 GMT"; src="rhiz",
205
+ <https://webarchives .rhizome.org/vvork/20141006184357id_/http://www.vvork.com/>; rel="memento"; datetime="Mon, 06 Oct 2014 18:43:57 GMT"; src="rhiz",
202
206
<http://wayback.archive-it.org/all/20131004231540id_/http://vvork.com/>; rel="memento"; datetime="Fri, 04 Oct 2013 23:15:40 GMT"; src="ait"
203
207
"""
204
208
assert (headers ['Content-Type' ] == 'application/link' )
@@ -223,7 +227,7 @@ def _test_handler_output_link_2(self):
223
227
assert (b'' .join (res ) == exp )
224
228
225
229
exp_errs = {'bl' : "NotFoundException('http://www.webarchive.org.uk/wayback/archive/http://iana.org/',)" ,
226
- 'rhiz' : "NotFoundException('https://webenact .rhizome.org/vvork/http://iana.org/',)" }
230
+ 'rhiz' : "NotFoundException('https://webarchives .rhizome.org/vvork/http://iana.org/',)" }
227
231
228
232
assert (errs == exp_errs )
229
233
@@ -242,7 +246,7 @@ def _test_handler_output_link_3(self):
242
246
exp_errs = {'ait' : "NotFoundException('http://wayback.archive-it.org/all/http://foo.bar.non-existent',)" ,
243
247
'bl' : "NotFoundException('http://www.webarchive.org.uk/wayback/archive/http://foo.bar.non-existent',)" ,
244
248
'ia' : "NotFoundException('http://web.archive.org/web/http://foo.bar.non-existent',)" ,
245
- 'rhiz' : "NotFoundException('https://webenact .rhizome.org/vvork/http://foo.bar.non-existent',)" }
249
+ 'rhiz' : "NotFoundException('https://webarchives .rhizome.org/vvork/http://foo.bar.non-existent',)" }
246
250
247
251
assert (errs == exp_errs )
248
252
@@ -253,7 +257,7 @@ def _test_handler_output_text(self):
253
257
headers , res , errs = handler (dict (url = url , closest = '20141001' , limit = 2 , sources = 'rhiz,ait' , output = 'text' ))
254
258
255
259
exp = b"""\
256
- com,vvork)/ 20141006184357 http://www.vvork.com/ memento https://webenact .rhizome.org/vvork/20141006184357/http://www.vvork.com/ https://webenact .rhizome.org/vvork/20141006184357id_/http://www.vvork.com/ rhiz
260
+ com,vvork)/ 20141006184357 http://www.vvork.com/ memento https://webarchives .rhizome.org/vvork/20141006184357/http://www.vvork.com/ https://webarchives .rhizome.org/vvork/20141006184357id_/http://www.vvork.com/ rhiz
257
261
com,vvork)/ 20131004231540 http://vvork.com/ last memento http://wayback.archive-it.org/all/20131004231540/http://vvork.com/ http://wayback.archive-it.org/all/20131004231540id_/http://vvork.com/ ait
258
262
"""
259
263
assert (headers ['Content-Type' ] == 'text/plain' )
0 commit comments