def test_strip(self, url_suffix): url_base = 'https://example.com/test' url = QUrl(url_base + url_suffix) assert url.isValid() stripped = navigate.strip(url, count=1) assert stripped.isValid() assert stripped == QUrl(url_base)
def test_invalid_url(self): with pytest.raises(urlutils.InvalidUrlError): navigate.strip(QUrl(), count=1)
def test_count(self): with pytest.raises(navigate.Error, match='Count is not supported'): navigate.strip(QUrl('https://example.com/'), count=2)