Skip to content

Commit

Permalink
cov
Browse files Browse the repository at this point in the history
  • Loading branch information
nkvuong committed Apr 25, 2024
1 parent f20264c commit d61fe4c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/unit/source_code/test_redash.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
def redash_ws():
def api_client_do(method: str, path: str, body: dict | None = None):
_ = body
tags_lookup = {"1": [Redash.BACKUP_TAG], "2": [Redash.MIGRATED_TAG, "backup: 123"], "3": []}
tags_lookup = {"1": [Redash.BACKUP_TAG], "2": [Redash.MIGRATED_TAG, "backup: 123", "original"], "3": []}
if method == "POST":
return {}
if path.startswith("/api/2.0/preview/sql/dashboards"):
dashboard_id = path.removeprefix("/api/2.0/preview/sql/dashboards/")
tags = tags_lookup[dashboard_id]
return {
"widgets": [
{},
{"visualization": {}},
{
"visualization": {
"query": {
Expand All @@ -32,7 +34,17 @@ def api_client_do(method: str, path: str, body: dict | None = None):
"tags": tags,
}
}
}
},
{
"visualization": {
"query": {
"id": "1",
"name": "test_query",
"query": "SELECT * FROM old.things",
"tags": None,
}
}
},
]
}
if path.startswith("/api/2.0/preview/sql/queries"):
Expand Down

0 comments on commit d61fe4c

Please sign in to comment.