Beispiel #1
0
    def test_hypothesis(self, source):
        scheme = 'javascript:'
        url = QUrl(scheme + urllib.parse.quote(source))
        hypothesis.assume(url.isValid())

        try:
            parsed = urlutils.parse_javascript_url(url)
        except urlutils.Error:
            pass
        else:
            assert parsed == source
Beispiel #2
0
 def test_valid(self, url, source):
     assert urlutils.parse_javascript_url(url) == source
Beispiel #3
0
 def test_invalid(self, url, message):
     with pytest.raises(urlutils.Error, match=message):
         urlutils.parse_javascript_url(url)