@@ -154,9 +154,9 @@ def test_all_products_are_shown(client: FlaskClient):
154
154
a .text .strip () for a in html .find (".product-selection-header .option-menu-link" )
155
155
)
156
156
indexed_product_names = sorted (p .name for p in _model .STORE .all_products ())
157
- assert (
158
- found_product_names == indexed_product_names
159
- ), "Product shown in menu don't match the indexed products"
157
+ assert found_product_names == indexed_product_names , (
158
+ "Product shown in menu don't match the indexed products"
159
+ )
160
160
161
161
162
162
def test_get_overview_product_links (client : FlaskClient ):
@@ -407,36 +407,36 @@ def test_api_returns_high_tide_comp_datasets(client: FlaskClient):
407
407
These are slightly fun to handle as they are a small number with a huge time range.
408
408
"""
409
409
geojson = get_geojson (client , "/api/datasets/high_tide_comp_20p" )
410
- assert (
411
- len ( geojson [ "features" ]) == 306
412
- ), "Not all high tide datasets returned as geojson"
410
+ assert len ( geojson [ "features" ]) == 306 , (
411
+ "Not all high tide datasets returned as geojson"
412
+ )
413
413
414
414
# Search and time summary is only based on center time.
415
415
# These searches are within the dataset time range, but not the center_time.
416
416
# Dataset range: '2000-01-01T00:00:00' to '2016-10-31T00:00:00'
417
417
# year
418
418
geojson = get_geojson (client , "/api/datasets/high_tide_comp_20p/2008" )
419
- assert (
420
- len ( geojson [ "features" ]) == 306
421
- ), "Expected high tide datasets within whole dataset range"
419
+ assert len ( geojson [ "features" ]) == 306 , (
420
+ "Expected high tide datasets within whole dataset range"
421
+ )
422
422
# month
423
423
geojson = get_geojson (client , "/api/datasets/high_tide_comp_20p/2008/6" )
424
- assert (
425
- len ( geojson [ "features" ]) == 306
426
- ), "Expected high tide datasets within whole dataset range"
424
+ assert len ( geojson [ "features" ]) == 306 , (
425
+ "Expected high tide datasets within whole dataset range"
426
+ )
427
427
# day
428
428
geojson = get_geojson (client , "/api/datasets/high_tide_comp_20p/2008/6/1" )
429
- assert (
430
- len ( geojson [ "features" ]) == 306
431
- ), "Expected high tide datasets within whole dataset range"
429
+ assert len ( geojson [ "features" ]) == 306 , (
430
+ "Expected high tide datasets within whole dataset range"
431
+ )
432
432
433
433
# Out of the test dataset time range. No results.
434
434
435
435
# Completely outside of range
436
436
geojson = get_geojson (client , "/api/datasets/high_tide_comp_20p/2018" )
437
- assert (
438
- len ( geojson [ "features" ]) == 0
439
- ), "Expected no high tide datasets in in this year"
437
+ assert len ( geojson [ "features" ]) == 0 , (
438
+ "Expected no high tide datasets in in this year"
439
+ )
440
440
# One day before/after (is time zone handling correct?)
441
441
geojson = get_geojson (client , "/api/datasets/high_tide_comp_20p/2008/6/2" )
442
442
assert len (geojson ["features" ]) == 0 , "Expected no result one-day-after center time"
@@ -469,9 +469,9 @@ def test_api_returns_high_tide_comp_regions(client: FlaskClient):
469
469
"""
470
470
471
471
rv : Response = client .get ("/api/regions/high_tide_comp_20p" )
472
- assert (
473
- rv . status_code == 404
474
- ), "High tide comp does not support regions: it should return not-exist code."
472
+ assert rv . status_code == 404 , (
473
+ "High tide comp does not support regions: it should return not-exist code."
474
+ )
475
475
476
476
477
477
def test_api_returns_scene_regions (client : FlaskClient ):
@@ -908,9 +908,9 @@ def test_with_timings(client: FlaskClient):
908
908
for f in rv .headers ["Server-Timing" ].split ("," )
909
909
if f .startswith ("odcquerycount_" )
910
910
]
911
- assert (
912
- count_header
913
- ), f"No query count server timing header found in { rv . headers [ 'Server-Timing' ] } "
911
+ assert count_header , (
912
+ f"No query count server timing header found in { rv . headers [ 'Server-Timing' ] } "
913
+ )
914
914
915
915
# Example header:
916
916
# app;dur=1034.12,odcquery;dur=103.03;desc="ODC query time",odcquerycount_6;desc="6 ODC queries"
@@ -969,9 +969,9 @@ def test_get_robots(client: FlaskClient):
969
969
num_lines = len (text .split ("\n " ))
970
970
assert num_lines > 1 , "robots.txt should have multiple lines"
971
971
972
- assert (
973
- rv . headers [ "Content-Type" ] == " text/plain"
974
- ), "robots.txt content-type should be text/plain"
972
+ assert rv . headers [ "Content-Type" ] == "text/plain" , (
973
+ "robots.txt content-type should be text/plain"
974
+ )
975
975
976
976
977
977
def test_all_give_404s (client : FlaskClient ):
0 commit comments