From e4297ddabec30f805f516b8fa1e6ee786dd18015 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Sun, 20 Jul 2014 18:25:47 -0700 Subject: [PATCH] tests: add integration tests for $liveweb rewrite handler and replay with fallback --- tests/test_config.yaml | 8 ++++++++ tests/test_integration.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/tests/test_config.yaml b/tests/test_config.yaml index bbb96849..c1e562f8 100644 --- a/tests/test_config.yaml +++ b/tests/test_config.yaml @@ -30,6 +30,14 @@ collections: index_paths: './sample_archive/non-surt-cdx/' surt_ordered: false + # live collection + live: $liveweb + + # coll with fallback + pywb-fallback: + index_paths: ./sample_archive/cdx/ + fallback: live + # indicate if cdx files are sorted by SURT keys -- eg: com,example)/ # SURT keys are recommended for future indices, but non-SURT cdxs diff --git a/tests/test_integration.py b/tests/test_integration.py index 9427e2af..4532b0d6 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -259,6 +259,14 @@ class TestWb: resp = self.testapp.get('/pywb/20140603030351mp_/http://example.com?example=3', status = 503) assert resp.status_int == 503 + def test_live_frame(self): + resp = self.testapp.get('/live/mp_/http://example.com/?test=test') + assert resp.status_int == 200 + + def test_live_fallback(self): + resp = self.testapp.get('/pywb-fallback/mp_/http://example.com/?test=test') + assert resp.status_int == 200 + def test_post_1(self): resp = self.testapp.post('/pywb/mp_/httpbin.org/post', {'foo': 'bar', 'test': 'abc'})