Skip to content

Commit

Permalink
Add missing card to test
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline committed Mar 4, 2024
1 parent fcf91cf commit bb23cee
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tests/_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {}


Expand Down
18 changes: 17 additions & 1 deletion tests/fixtures/api/collection/3/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]",
"timestamp": "2021-07-21T08:01:37.449936Z"
},
"favorite": false,
"model": "card"
}
]
]

0 comments on commit bb23cee

Please sign in to comment.