1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00
pywb/tests/test_prefixed_deploy.py
Tessa Walsh c28941a0b6 Rework Vue banner UI
- Make Vue banner responsive with Bootstrap 4
- Add previous/next year arrows to calendar
- Make navbar background, text color, and button outlines configurable
via config.yaml
- Toggle calendar and timeline separately
- Fix bug preventing title from displaying
- Make app keyboard-navigable
- Fix banner background color configuration
- Comment out vue_navbar_background_hash
- Display linear timeline tooltip centrally on enter
- Improve header styling on small screens
- Add titles to font awesome icons
- Remove old default banner (calendar retained for advanced search
  results)
- Fix TimelineLinear TypeError that broke calendar
- Bump version to 2.7.0b2
- Set Cache-Control header on CDXJ API response to mark returned CDX as
stale after 1 day
- Add commented out UI values to config.yaml to aid users
- Remove timeline and calendar card borders
- Fix issues with snapshot navigation
- Center search bar and align with buttons
- Make Vue app bfcache-ineligible: By adding an empty unload event
listener, we make pages serving the Vue app ineligible for bfcache,
which prevents unexpected behavior when navigating via the browser's
back/forward buttons.
2022-11-21 12:46:09 -05:00

51 lines
1.9 KiB
Python

from .base_config_test import BaseConfigTest, fmod
# ============================================================================
class TestPrefixedDeploy(BaseConfigTest):
@classmethod
def setup_class(cls):
super(TestPrefixedDeploy, cls).setup_class('config_test.yaml')
def get(self, url, fmod=''):
return super(TestPrefixedDeploy, self).get(url, fmod,
extra_environ={'SCRIPT_NAME': '/prefix',
'REQUEST_URI': 'http://localhost:80/prefix' + url})
def test_home(self):
resp = self.get('/prefix/')
print(resp.text)
self._assert_basic_html(resp)
assert '/prefix/pywb' in resp.text
def test_pywb_root(self):
resp = self.get('/prefix/pywb/')
self._assert_basic_html(resp)
assert 'Search' in resp.text
def test_calendar_query(self):
resp = self.get('/prefix/pywb/*/iana.org')
self._assert_basic_html(resp)
assert '/prefix/static/vue/vueui.js' in resp.text
def test_replay_content(self, fmod):
resp = self.get('/prefix/pywb/20140127171238{0}/http://www.iana.org/', fmod)
self._assert_basic_html(resp)
assert '"20140127171238"' in resp.text, resp.text
assert "'http://localhost:80/prefix/static/wombat.js'" in resp.text
assert "http://localhost:80/prefix/static/vue/vueui.js" in resp.text
assert '"http://localhost:80/prefix/static/"' in resp.text
assert '"http://localhost:80/prefix/pywb/"' in resp.text
assert 'WBWombatInit' in resp.text, resp.text
assert '"/prefix/pywb/20140127171238{0}/http://www.iana.org/time-zones"'.format(fmod) in resp.text, resp.text
def test_static_content(self):
resp = self.get('/prefix/static/vue_banner.css')
assert resp.status_int == 200
assert resp.content_type == 'text/css'
assert resp.content_length > 0