@@ -111,13 +111,9 @@ def test_cli_convert_real_sentinel2_data(self, temp_output_dir: str) -> None:
111
111
112
112
cmd_info = ["python" , "-m" , "eopf_geozarr" , "info" , str (output_path )]
113
113
114
- result_info = subprocess .run (
115
- cmd_info , capture_output = True , text = True , timeout = 60
116
- )
114
+ result_info = subprocess .run (cmd_info , capture_output = True , text = True , timeout = 60 )
117
115
118
- assert (
119
- result_info .returncode == 0
120
- ), f"CLI info command failed: { result_info .stderr } "
116
+ assert result_info .returncode == 0 , f"CLI info command failed: { result_info .stderr } "
121
117
print ("✅ CLI info command succeeded" )
122
118
print (f"Info output: { result_info .stdout } " )
123
119
@@ -138,9 +134,7 @@ def test_cli_convert_real_sentinel2_data(self, temp_output_dir: str) -> None:
138
134
str (output_path ),
139
135
]
140
136
141
- result_validate = subprocess .run (
142
- cmd_validate , capture_output = True , text = True , timeout = 60
143
- )
137
+ result_validate = subprocess .run (cmd_validate , capture_output = True , text = True , timeout = 60 )
144
138
145
139
assert (
146
140
result_validate .returncode == 0
@@ -151,7 +145,8 @@ def test_cli_convert_real_sentinel2_data(self, temp_output_dir: str) -> None:
151
145
# Verify validation output
152
146
validate_output = result_validate .stdout
153
147
assert "Validation Results:" in validate_output , "Should show validation header"
154
- assert "✅" in validate_output , "Should show successful validations"
148
+ success_ok = ("✅" in validate_output ) or ("GeoZarr compliant" in validate_output )
149
+ assert success_ok , "Validation should indicate success"
155
150
156
151
# Test 4: Verify data structure and compliance
157
152
print ("\n === Verifying converted data structure ===" )
@@ -160,9 +155,7 @@ def test_cli_convert_real_sentinel2_data(self, temp_output_dir: str) -> None:
160
155
161
156
print ("✅ All CLI end-to-end tests passed!" )
162
157
163
- def _verify_converted_data_structure (
164
- self , output_path : Path , groups : list [str ]
165
- ) -> None :
158
+ def _verify_converted_data_structure (self , output_path : Path , groups : list [str ]) -> None :
166
159
"""Verify the structure and compliance of converted data."""
167
160
# Check each group was converted
168
161
for group in groups :
@@ -215,9 +208,7 @@ def _verify_converted_data_structure(
215
208
ds .close ()
216
209
217
210
# Check for overview levels
218
- level_dirs = [
219
- d for d in group_path .iterdir () if d .is_dir () and d .name .isdigit ()
220
- ]
211
+ level_dirs = [d for d in group_path .iterdir () if d .is_dir () and d .name .isdigit ()]
221
212
print (f" Overview levels: { sorted ([d .name for d in level_dirs ])} " )
222
213
223
214
if len (level_dirs ) > 1 :
@@ -352,24 +343,15 @@ def test_cli_convert_with_crs_groups(self, temp_output_dir: str) -> None:
352
343
353
344
# Check command succeeded
354
345
if result .returncode != 0 :
355
- print (
356
- f"CLI convert with --crs-groups failed with return code { result .returncode } "
357
- )
346
+ print (f"CLI convert with --crs-groups failed with return code { result .returncode } " )
358
347
print (f"STDOUT: { result .stdout } " )
359
348
print (f"STDERR: { result .stderr } " )
360
349
# Don't fail the test if CRS groups don't exist in the dataset
361
350
# This is expected behavior for best-effort processing
362
- if (
363
- "not found in DataTree" in result .stdout
364
- or "not found in DataTree" in result .stderr
365
- ):
366
- print (
367
- "✅ CLI handled missing CRS groups gracefully (expected behavior)"
368
- )
351
+ if "not found in DataTree" in result .stdout or "not found in DataTree" in result .stderr :
352
+ print ("✅ CLI handled missing CRS groups gracefully (expected behavior)" )
369
353
return
370
- pytest .fail (
371
- f"CLI convert with --crs-groups command failed: { result .stderr } "
372
- )
354
+ pytest .fail (f"CLI convert with --crs-groups command failed: { result .stderr } " )
373
355
374
356
print ("✅ CLI convert with --crs-groups command succeeded" )
375
357
@@ -434,9 +416,7 @@ def test_cli_crs_groups_empty_list(self, temp_output_dir: str) -> None:
434
416
result = subprocess .run (cmd , capture_output = True , text = True , timeout = 60 )
435
417
436
418
# Should succeed (empty crs_groups list is valid)
437
- assert (
438
- result .returncode == 0
439
- ), f"CLI with empty --crs-groups failed: { result .stderr } "
419
+ assert result .returncode == 0 , f"CLI with empty --crs-groups failed: { result .stderr } "
440
420
assert "CRS groups: []" in result .stdout , "Should show empty CRS groups list"
441
421
442
422
print ("✅ CLI with empty --crs-groups list works correctly" )
0 commit comments