Skip to content

Commit fdf13e1

Browse files
committed
fix: annotations
1 parent 32baf4a commit fdf13e1

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

dandischema/tests/test_google_dataset_metadata.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ def sample_dandiset_metadata() -> Dict[str, Any]:
6666
}
6767

6868

69-
def test_google_dataset_metadata_basic_transformation(sample_dandiset_metadata):
69+
def test_google_dataset_metadata_basic_transformation(
70+
sample_dandiset_metadata: Dict[str, Any]
71+
) -> None:
7072
"""Test that the basic transformation works correctly"""
7173
result = google_dataset_metadata(sample_dandiset_metadata)
7274

@@ -106,7 +108,9 @@ def test_google_dataset_metadata_basic_transformation(sample_dandiset_metadata):
106108
assert "DANDI" in result["keywords"]
107109

108110

109-
def test_google_dataset_metadata_preserves_original(sample_dandiset_metadata):
111+
def test_google_dataset_metadata_preserves_original(
112+
sample_dandiset_metadata: Dict[str, Any]
113+
) -> None:
110114
"""Test that the original metadata is not modified"""
111115
original = copy.deepcopy(sample_dandiset_metadata)
112116
google_dataset_metadata(sample_dandiset_metadata)
@@ -115,7 +119,9 @@ def test_google_dataset_metadata_preserves_original(sample_dandiset_metadata):
115119
assert original == sample_dandiset_metadata
116120

117121

118-
def test_google_dataset_metadata_with_existing_creator(sample_dandiset_metadata):
122+
def test_google_dataset_metadata_with_existing_creator(
123+
sample_dandiset_metadata: Dict[str, Any]
124+
) -> None:
119125
"""Test that existing creator is preserved"""
120126
# Add a creator field
121127
sample_dandiset_metadata["creator"] = [
@@ -132,7 +138,9 @@ def test_google_dataset_metadata_with_existing_creator(sample_dandiset_metadata)
132138
assert result["creator"] == sample_dandiset_metadata["creator"]
133139

134140

135-
def test_google_dataset_metadata_with_existing_keywords(sample_dandiset_metadata):
141+
def test_google_dataset_metadata_with_existing_keywords(
142+
sample_dandiset_metadata: Dict[str, Any]
143+
) -> None:
136144
"""Test that existing keywords are preserved and extended"""
137145
# Add keywords field
138146
sample_dandiset_metadata["keywords"] = ["test", "example"]
@@ -148,7 +156,9 @@ def test_google_dataset_metadata_with_existing_keywords(sample_dandiset_metadata
148156
assert "DANDI" in result["keywords"]
149157

150158

151-
def test_google_dataset_metadata_with_no_license(sample_dandiset_metadata):
159+
def test_google_dataset_metadata_with_no_license(
160+
sample_dandiset_metadata: Dict[str, Any]
161+
) -> None:
152162
"""Test handling when no license is present"""
153163
# Remove license field
154164
no_license_metadata = copy.deepcopy(sample_dandiset_metadata)
@@ -160,7 +170,9 @@ def test_google_dataset_metadata_with_no_license(sample_dandiset_metadata):
160170
assert "license" not in result
161171

162172

163-
def test_google_dataset_metadata_with_no_contributors(sample_dandiset_metadata):
173+
def test_google_dataset_metadata_with_no_contributors(
174+
sample_dandiset_metadata: Dict[str, Any]
175+
) -> None:
164176
"""Test handling when no contributors are present"""
165177
# Remove contributor field
166178
no_contributor_metadata = copy.deepcopy(sample_dandiset_metadata)
@@ -172,7 +184,9 @@ def test_google_dataset_metadata_with_no_contributors(sample_dandiset_metadata):
172184
assert "schema:creator" not in result
173185

174186

175-
def test_google_dataset_metadata_with_date_published(sample_dandiset_metadata):
187+
def test_google_dataset_metadata_with_date_published(
188+
sample_dandiset_metadata: Dict[str, Any]
189+
) -> None:
176190
"""Test handling of datePublished field"""
177191
# Add datePublished field
178192
sample_dandiset_metadata["datePublished"] = "2023-01-01T00:00:00Z"
@@ -183,7 +197,9 @@ def test_google_dataset_metadata_with_date_published(sample_dandiset_metadata):
183197
assert result["datePublished"] == "2023-01-01T00:00:00Z"
184198

185199

186-
def test_google_dataset_metadata_with_date_created_fallback(sample_dandiset_metadata):
200+
def test_google_dataset_metadata_with_date_created_fallback(
201+
sample_dandiset_metadata: Dict[str, Any]
202+
) -> None:
187203
"""Test fallback to dateCreated when datePublished is not present"""
188204
# Add dateCreated field
189205
sample_dandiset_metadata["dateCreated"] = "2022-01-01T00:00:00Z"

0 commit comments

Comments
 (0)