diff --git a/tests/_mocks.py b/tests/_mocks.py index b3234d3..a222702 100644 --- a/tests/_mocks.py +++ b/tests/_mocks.py @@ -2,6 +2,8 @@ from pathlib import Path from typing import Any, Dict, Mapping, Optional, Sequence +import requests + from dbtmetabase.core import DbtMetabase from dbtmetabase.manifest import Manifest, Model from dbtmetabase.metabase import Metabase @@ -37,6 +39,10 @@ def _api( if json_path.exists(): with open(json_path, encoding="utf-8") as f: return json.load(f) + else: + response = requests.Response() + response.status_code = 404 + raise requests.exceptions.HTTPError(response=response) return {} diff --git a/tests/fixtures/api/collection/3/items.json b/tests/fixtures/api/collection/3/items.json index 523238c..e5e7a91 100644 --- a/tests/fixtures/api/collection/3/items.json +++ b/tests/fixtures/api/collection/3/items.json @@ -253,5 +253,21 @@ }, "favorite": false, "model": "card" + }, + { + "description": null, + "collection_position": null, + "name": "Missing", + "id": 404, + "display": "scalar", + "last-edit-info": { + "id": 1, + "last_name": "", + "first_name": "dbtmetabase", + "email": "user@example.com", + "timestamp": "2021-07-21T08:01:37.449936Z" + }, + "favorite": false, + "model": "card" } -] \ No newline at end of file +]