2017-08-07 22:09:02 -07:00
|
|
|
from .base_config_test import BaseConfigTest, fmod
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
class TestRootColl(BaseConfigTest):
|
|
|
|
@classmethod
|
|
|
|
def setup_class(cls):
|
|
|
|
super(TestRootColl, cls).setup_class('config_test_root_coll.yaml')
|
|
|
|
|
|
|
|
def test_root_replay_ts(self, fmod):
|
|
|
|
resp = self.get('/20140127171238{0}/http://www.iana.org/', fmod)
|
|
|
|
|
|
|
|
# Body
|
|
|
|
assert '"20140127171238"' in resp.text
|
Frame insert refactor (#246)
refactor frame/head insert templates:
ContentFrame:
- content iframe inited with new ContentFrame() which creates iframe
- wb_frame.js: contains ContentFrame system for initing, updating, closing content frame for replayed content.
- wb_frame.js: supports 'app_prefix' and 'content_prefix' or default 'prefix' for replay content
- window.location.hash passed added to init url.
- frame insert and head insert: simplify, remove 'wbrequest'
- frame insert: global wbinfo object no longer needed in top frame, each ContentFrame self-contained.
- wombat.js: next_parent() check does not assume wbinfo is present in top frame
- vidrw.js: only init if wbinfo is present
Banner:
- wb.js no longer needed, frame check/redirect folded into wombat.js
- default banner self-contained in default_banner.js/default_banner.css, handles both frame and frameless case
- rename wb.css -> default_banner.css
- banner html passed in as 'banner_html' variable to be optionally included, supports per collection banner html.
- templateview: BaseInsertView can accept an option 'banner view', used by HeadInsertView and TopFrameView
Tests:
- tests: test_auto_colls uses shared app to test dynamic changes, testing both frame and non-frame access, added per-collection banner html check.
2017-09-30 21:09:38 -07:00
|
|
|
assert 'wombat.js' in resp.text
|
2017-08-07 22:09:02 -07:00
|
|
|
assert 'new _WBWombat' in resp.text, resp.text
|
|
|
|
assert '/20140127171238{0}/http://www.iana.org/time-zones"'.format(fmod) in resp.text
|
|
|
|
|
|
|
|
def test_root_replay_no_ts(self, fmod):
|
|
|
|
fmod_slash = fmod + '/' if fmod else ''
|
|
|
|
resp = self.get('/{0}http://www.iana.org/', fmod_slash)
|
|
|
|
|
|
|
|
# Body
|
|
|
|
assert 'request_ts = ""' in resp.text
|
Frame insert refactor (#246)
refactor frame/head insert templates:
ContentFrame:
- content iframe inited with new ContentFrame() which creates iframe
- wb_frame.js: contains ContentFrame system for initing, updating, closing content frame for replayed content.
- wb_frame.js: supports 'app_prefix' and 'content_prefix' or default 'prefix' for replay content
- window.location.hash passed added to init url.
- frame insert and head insert: simplify, remove 'wbrequest'
- frame insert: global wbinfo object no longer needed in top frame, each ContentFrame self-contained.
- wombat.js: next_parent() check does not assume wbinfo is present in top frame
- vidrw.js: only init if wbinfo is present
Banner:
- wb.js no longer needed, frame check/redirect folded into wombat.js
- default banner self-contained in default_banner.js/default_banner.css, handles both frame and frameless case
- rename wb.css -> default_banner.css
- banner html passed in as 'banner_html' variable to be optionally included, supports per collection banner html.
- templateview: BaseInsertView can accept an option 'banner view', used by HeadInsertView and TopFrameView
Tests:
- tests: test_auto_colls uses shared app to test dynamic changes, testing both frame and non-frame access, added per-collection banner html check.
2017-09-30 21:09:38 -07:00
|
|
|
assert 'wombat.js' in resp.text
|
2017-08-07 22:09:02 -07:00
|
|
|
assert 'new _WBWombat' in resp.text, resp.text
|
|
|
|
assert '/{0}http://www.iana.org/time-zones"'.format(fmod_slash) in resp.text
|
|
|
|
|
|
|
|
def test_root_replay_redir(self, fmod):
|
|
|
|
resp = self.get('/20140128051539{0}/http://www.iana.org/domains/example', fmod)
|
|
|
|
|
|
|
|
assert resp.status_int == 302
|
|
|
|
|
|
|
|
assert resp.headers['Location'] == 'http://localhost:80/20140128051539{0}/https://www.iana.org/domains/reserved'.format(fmod)
|
|
|
|
|
|
|
|
def test_root_home_search(self):
|
|
|
|
resp = self.testapp.get('/')
|
|
|
|
assert 'Search' in resp.text
|
|
|
|
|
2017-09-06 23:25:30 -07:00
|
|
|
def test_root_cdx(self):
|
|
|
|
resp = self.testapp.get('/cdx?url=http://www.iana.org/&output=json&limit=1')
|
|
|
|
resp.content_type = 'application/json'
|
|
|
|
assert resp.json['is_live'] == 'true'
|
|
|
|
assert resp.json['url'] == 'http://www.iana.org/'
|
|
|
|
assert resp.json['source'] == '$root'
|