3
3
from pytest_mock import MockerFixture
4
4
5
5
from oc4ids_datastore_api .models import DatasetSQLModel
6
- from oc4ids_datastore_api .schemas import Dataset , Download , License , Publisher
6
+ from oc4ids_datastore_api .schemas import Dataset , Download , License , Portal , Publisher
7
7
from oc4ids_datastore_api .services import get_all_datasets
8
8
9
9
@@ -20,6 +20,8 @@ def test_get_all_datasets(mocker: MockerFixture) -> None:
20
20
license_url = "https://license.com" ,
21
21
license_title = "License" ,
22
22
license_title_short = "L" ,
23
+ portal_url = "https://portal.com" ,
24
+ portal_title = "Portal" ,
23
25
json_url = "https://downloads/test_dataset.json" ,
24
26
csv_url = "https://downloads/test_dataset.csv" ,
25
27
xlsx_url = "https://downloads/test_dataset.xlsx" ,
@@ -34,6 +36,7 @@ def test_get_all_datasets(mocker: MockerFixture) -> None:
34
36
source_url = "https://test-dataset.json" ,
35
37
publisher = Publisher (name = "test_publisher" , country = "ab" ),
36
38
license = License (title = "License" , title_short = "L" , url = "https://license.com" ),
39
+ portal = Portal (title = "Portal" , url = "https://portal.com" ),
37
40
downloads = [
38
41
Download (format = "json" , url = "https://downloads/test_dataset.json" ),
39
42
Download (format = "csv" , url = "https://downloads/test_dataset.csv" ),
@@ -69,6 +72,7 @@ def test_get_all_datasets_missing_download_formats(mocker: MockerFixture) -> Non
69
72
source_url = "https://test-dataset.json" ,
70
73
publisher = Publisher (name = "test_publisher" , country = None ),
71
74
license = License (title = "License" , title_short = "L" , url = "https://license.com" ),
75
+ portal = Portal (title = None , url = None ),
72
76
downloads = [
73
77
Download (format = "json" , url = "https://downloads/test_dataset.json" ),
74
78
],
0 commit comments