diff --git a/tests/wqp_test.py b/tests/wqp_test.py index fd34ae4..7170ddb 100755 --- a/tests/wqp_test.py +++ b/tests/wqp_test.py @@ -4,11 +4,18 @@ from pandas import DataFrame -from dataretrieval.wqp import (get_results, what_sites, what_organizations, - what_projects, what_activities, - what_detection_limits, what_habitat_metrics, - what_project_weights, what_activity_metrics, - _alter_kwargs) +from dataretrieval.wqp import ( + get_results, + what_sites, + what_organizations, + what_projects, + what_activities, + what_detection_limits, + what_habitat_metrics, + what_project_weights, + what_activity_metrics, + _check_mimetype, +) def test_get_results(requests_mock): @@ -171,12 +178,11 @@ def mock_request(requests_mock, request_url, file_path): requests_mock.get(request_url, text=text.read(), headers={"mock_header": "value"}) -class TestAlterKwargs: - """Tests for keyword alteration. - """ - def test_alter_kwargs_mimetype(self): - """Tests that mimetype kwarg is altered correctly and warning is thrown.""" - kwargs = {"mimeType": "geojson"} - with pytest.warns(UserWarning): - kwargs = _alter_kwargs(kwargs) - assert kwargs == {"mimeType": "csv"} \ No newline at end of file +def test_check_mimetype(self): + """Tests that correct errors are raised for invalid mimetypes.""" + kwargs = {"mimeType": "geojson"} + with pytest.raises(NotImplementedError): + kwargs = _check_mimetype(kwargs) + kwargs = {"mimeType": "foo"} + with pytest.raises(ValueError): + kwargs = _check_mimetype(kwargs)