from stapler.page import Page from . import BaseTestCase class TestPage(BaseTestCase): def test_repr(self) -> None: self.assertEqual(str(Page("test_1", with_index=True)), "/test_1/") def test_repr_no_index(self) -> None: self.assertEqual(str(Page("test_1", with_index=False)), "/test_1/ (no index)") def test_repr_with_host(self) -> None: self.assertEqual( str(Page("test_1", with_index=True, host="example.com")), "/test_1/ [example.com]", ) def test_repr_with_redirect(self) -> None: self.assertEqual( str(Page("test_1", redirect="https://example.com")), "/test_1/ (redirect: https://example.com)", ) def test_repr_with_proxy(self) -> None: self.assertEqual( str(Page("test_1", proxy="https://example.com")), "/test_1/ (proxy: https://example.com)", ) def test_repr_with_host_only(self) -> None: self.assertEqual( str(Page("test_1", with_index=True, host_only=True)), "/test_1/ (host only)", ) def test_repr_with_spa(self) -> None: self.assertEqual( str(Page("test_1", with_index=True, spa="index.html")), "/test_1/ (spa: index.html)", )