Skip to content

Commit

Permalink
Update test for metadata url validator
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Apr 18, 2024
1 parent dc42e8d commit c26faa1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions qgis-app/plugins/tests/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ def test_invalid_metadata_web_does_not_exist(self):

@mock.patch("requests.get", side_effect=requests.exceptions.SSLError())
def test_check_url_link_ssl_error(self, mock_request):
url = "http://example.com/"
self.assertIsNone(_check_url_link(url, "forbidden_url", "metadata attribute"))
urls = [{'url': "http://example.com/", 'forbidden_url': "forbidden_url", 'metadata_attr': "metadata attribute"}]
self.assertIsNone(_check_url_link(urls))

@mock.patch("requests.get", side_effect=requests.exceptions.HTTPError())
def test_check_url_link_does_not_exist(self, mock_request):
url = "http://example.com/"
urls = [{'url': "http://example.com/", 'forbidden_url': "forbidden_url", 'metadata_attr': "metadata attribute"}]
self.assertRaises(
ValidationError,
_check_url_link(url, "forbidden_url", "metadata attribute"),
_check_url_link(urls),
)


Expand Down

0 comments on commit c26faa1

Please sign in to comment.