diff --git a/tests/email/test_email.py b/tests/email/test_email.py index 932e051..57b9ea5 100644 --- a/tests/email/test_email.py +++ b/tests/email/test_email.py @@ -36,7 +36,7 @@ def test_ses_client_initialisation_invalid_sender_email(): with pytest.raises(ValueError) as e: SesClient("invalid_email", "us-west-2") - assert "Invalid sender email: The email address is not valid." in str(e.value) + assert "Invalid sender email: An email address must have an @-sign." in str(e.value) @mock_aws @@ -60,7 +60,7 @@ def test_ses_client_send_invalid_recipient(mock_ses_client): with pytest.raises(ValueError) as e: mock_ses_client.send("invalid_email", "subject", "body") - assert "Invalid recipient email: The email address is not valid." in str(e.value) + assert "Invalid recipient email: An email address must have an @-sign." in str(e.value) @mock_aws diff --git a/tests/http/dataset/test_dataset_api.py b/tests/http/dataset/test_dataset_api.py index 322cbc7..59bba22 100644 --- a/tests/http/dataset/test_dataset_api.py +++ b/tests/http/dataset/test_dataset_api.py @@ -54,6 +54,7 @@ def test_post_json_success(mock_request): verify=True, ) + @patch("requests.request") def test_post_json_failure(mock_request): """ @@ -71,6 +72,7 @@ def test_post_json_failure(mock_request): with pytest.raises(Exception): mock_client.post_json() + @patch("requests.request") def test_post_new_job_success(mock_request): """ @@ -105,6 +107,7 @@ def test_post_new_job_failure(mock_request): with pytest.raises(Exception): mock_client.post_new_job() + @patch("builtins.open", new_callable=mock_open, read_data='{"key": "value"}') @patch("requests.request") def test_upload_json(mock_request, mock_open_file):