-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: unicode collections and separate pytest fixtures
- Loading branch information
Showing
24 changed files
with
163 additions
and
140 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pytest | ||
|
||
from tests._mocks import TMP_PATH, MockDbtMetabase, MockMetabase | ||
|
||
|
||
@pytest.fixture(name="core") | ||
def fixture_core() -> MockDbtMetabase: | ||
c = MockDbtMetabase() | ||
c._ModelsMixin__SYNC_PERIOD = 1 # type: ignore | ||
return c | ||
|
||
|
||
@pytest.fixture(name="metabase") | ||
def fixture_metabase() -> MockMetabase: | ||
return MockMetabase(url="http://localhost") | ||
|
||
|
||
def setup_module(): | ||
TMP_PATH.mkdir(exist_ok=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"cache_invalidated_at": null, | ||
"description": "Orders and customers", | ||
"archived": false, | ||
"view_count": 446, | ||
"view_count": 458, | ||
"collection_position": null, | ||
"table_id": 10, | ||
"can_run_adhoc_query": true, | ||
|
@@ -561,7 +561,7 @@ | |
"creator": { | ||
"email": "[email protected]", | ||
"first_name": "dbtmetabase", | ||
"last_login": "2024-11-02T04:41:42.402168Z", | ||
"last_login": "2024-12-20T12:30:47.814008Z", | ||
"is_qbnewb": false, | ||
"is_superuser": true, | ||
"id": 1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"cache_invalidated_at": null, | ||
"description": null, | ||
"archived": false, | ||
"view_count": 223, | ||
"view_count": 229, | ||
"collection_position": null, | ||
"table_id": 10, | ||
"can_run_adhoc_query": true, | ||
|
@@ -549,7 +549,7 @@ | |
"creator": { | ||
"email": "[email protected]", | ||
"first_name": "dbtmetabase", | ||
"last_login": "2024-11-02T04:41:42.402168Z", | ||
"last_login": "2024-12-20T12:30:47.814008Z", | ||
"is_qbnewb": false, | ||
"is_superuser": true, | ||
"id": 1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"cache_invalidated_at": null, | ||
"description": null, | ||
"archived": false, | ||
"view_count": 222, | ||
"view_count": 228, | ||
"collection_position": null, | ||
"table_id": null, | ||
"can_run_adhoc_query": true, | ||
|
@@ -41,7 +41,7 @@ | |
"creator": { | ||
"email": "[email protected]", | ||
"first_name": "dbtmetabase", | ||
"last_login": "2024-11-02T04:41:42.402168Z", | ||
"last_login": "2024-12-20T12:30:47.814008Z", | ||
"is_qbnewb": false, | ||
"is_superuser": true, | ||
"id": 1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"cache_invalidated_at": null, | ||
"description": "Dummy 1", | ||
"archived": false, | ||
"view_count": 43, | ||
"view_count": 47, | ||
"collection_position": null, | ||
"table_id": null, | ||
"can_run_adhoc_query": true, | ||
|
@@ -41,7 +41,7 @@ | |
"creator": { | ||
"email": "[email protected]", | ||
"first_name": "dbtmetabase", | ||
"last_login": "2024-11-02T04:41:42.402168Z", | ||
"last_login": "2024-12-20T12:30:47.814008Z", | ||
"is_qbnewb": false, | ||
"is_superuser": true, | ||
"id": 1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"cache_invalidated_at": null, | ||
"description": "Dummy 2", | ||
"archived": false, | ||
"view_count": 43, | ||
"view_count": 47, | ||
"collection_position": null, | ||
"table_id": null, | ||
"can_run_adhoc_query": true, | ||
|
@@ -41,7 +41,7 @@ | |
"creator": { | ||
"email": "[email protected]", | ||
"first_name": "dbtmetabase", | ||
"last_login": "2024-11-02T04:41:42.402168Z", | ||
"last_login": "2024-12-20T12:30:47.814008Z", | ||
"is_qbnewb": false, | ||
"is_superuser": true, | ||
"id": 1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"cache_invalidated_at": null, | ||
"description": "CTE SQL", | ||
"archived": false, | ||
"view_count": 34, | ||
"view_count": 38, | ||
"collection_position": null, | ||
"table_id": null, | ||
"can_run_adhoc_query": true, | ||
|
@@ -276,7 +276,7 @@ | |
"creator": { | ||
"email": "[email protected]", | ||
"first_name": "dbtmetabase", | ||
"last_login": "2024-11-02T04:41:42.402168Z", | ||
"last_login": "2024-12-20T12:30:47.814008Z", | ||
"is_qbnewb": false, | ||
"is_superuser": true, | ||
"id": 1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"cache_invalidated_at": null, | ||
"description": null, | ||
"archived": false, | ||
"view_count": 15, | ||
"view_count": 19, | ||
"collection_position": null, | ||
"table_id": 18, | ||
"can_run_adhoc_query": true, | ||
|
@@ -146,7 +146,7 @@ | |
"creator": { | ||
"email": "[email protected]", | ||
"first_name": "dbtmetabase", | ||
"last_login": "2024-11-02T04:41:42.402168Z", | ||
"last_login": "2024-12-20T12:30:47.814008Z", | ||
"is_qbnewb": false, | ||
"is_superuser": true, | ||
"id": 1, | ||
|
@@ -158,17 +158,17 @@ | |
"can_write": true, | ||
"database_id": 2, | ||
"enable_embedding": false, | ||
"collection_id": null, | ||
"collection_id": 3, | ||
"query_type": "query", | ||
"name": "Transactions", | ||
"last_query_start": "2024-10-12T03:53:32.250619Z", | ||
"last_query_start": "2024-12-20T12:30:05.862314Z", | ||
"dashboard_count": 0, | ||
"last_used_at": "2024-10-12T03:43:09.869884Z", | ||
"last_used_at": "2024-12-20T12:30:05.932096Z", | ||
"type": "question", | ||
"average_query_time": 114.5, | ||
"average_query_time": 134.33333333333334, | ||
"creator_id": 1, | ||
"moderation_reviews": [], | ||
"updated_at": "2024-10-12T01:52:30.606845Z", | ||
"updated_at": "2024-12-20T12:30:11.735631Z", | ||
"made_public_by_id": null, | ||
"embedding_params": null, | ||
"cache_ttl": null, | ||
|
@@ -189,18 +189,26 @@ | |
"email": "[email protected]", | ||
"first_name": "dbtmetabase", | ||
"last_name": null, | ||
"timestamp": "2024-10-11T23:46:29.299411Z" | ||
"timestamp": "2024-12-20T12:30:11.782155Z" | ||
}, | ||
"visualization_settings": { | ||
"table.cell_column": "payment_id" | ||
}, | ||
"collection": { | ||
"metabase.models.collection.root/is-root?": true, | ||
"authority_level": null, | ||
"name": "Our analytics", | ||
"description": null, | ||
"archived": false, | ||
"slug": "%D0%BA%D0%BE%D0%BB%D0%BB%D0%B5%D0%BA%D1%86%D0%B8%D1%8F", | ||
"name": "\u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f", | ||
"personal_owner_id": null, | ||
"type": null, | ||
"is_sample": false, | ||
"id": 3, | ||
"entity_id": "4Zdu-bk8RhwuFiEiRXuOH", | ||
"location": "/", | ||
"namespace": null, | ||
"is_personal": false, | ||
"id": "root", | ||
"can_write": true | ||
"created_at": "2024-12-20T12:29:39.063908Z" | ||
}, | ||
"metabase_version": "v0.50.5 (48f6978)", | ||
"parameters": [], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[ | ||
{ | ||
"description": null, | ||
"collection_position": null, | ||
"can_write": true, | ||
"database_id": 2, | ||
"collection_id": 3, | ||
"name": "Transactions", | ||
"fully_parameterized": true, | ||
"moderated_status": null, | ||
"id": 33, | ||
"display": "table", | ||
"entity_id": "ZRX529pNYbPiCLCi8HvZ6", | ||
"collection_preview": true, | ||
"last-edit-info": { | ||
"id": 1, | ||
"last_name": null, | ||
"first_name": "dbtmetabase", | ||
"email": "[email protected]", | ||
"timestamp": "2024-12-20T12:30:11.782155Z" | ||
}, | ||
"location": null, | ||
"model": "card" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,28 +155,5 @@ | |
}, | ||
"location": null, | ||
"model": "dashboard" | ||
}, | ||
{ | ||
"description": null, | ||
"collection_position": null, | ||
"can_write": true, | ||
"database_id": 2, | ||
"collection_id": null, | ||
"name": "Transactions", | ||
"fully_parameterized": true, | ||
"moderated_status": null, | ||
"id": 33, | ||
"display": "table", | ||
"entity_id": "ZRX529pNYbPiCLCi8HvZ6", | ||
"collection_preview": true, | ||
"last-edit-info": { | ||
"id": 1, | ||
"last_name": null, | ||
"first_name": "dbtmetabase", | ||
"email": "[email protected]", | ||
"timestamp": "2024-10-11T23:46:29.299411Z" | ||
}, | ||
"location": null, | ||
"model": "card" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.