diff --git a/tests/endpoints/test_dump_qc_states.py b/tests/endpoints/test_dump_qc_states.py index 6fef2d5..d544a7b 100644 --- a/tests/endpoints/test_dump_qc_states.py +++ b/tests/endpoints/test_dump_qc_states.py @@ -80,7 +80,7 @@ def test_get_qc(test_client: TestClient, load_data4well_retrieval): assert response.status_code == 200 response_data = response.json() assert len(response_data) == 18 - assert sum([len(l) for (id, l) in response_data.items()]) == 34 + assert sum([len(l) for l in response_data.values()]) == 34 response = test_client.get( f"/products/qc?weeks={num_weeks}&final=false&seq_level=no" @@ -88,13 +88,13 @@ def test_get_qc(test_client: TestClient, load_data4well_retrieval): assert response.status_code == 200 response_data = response.json() assert len(response_data) == 18 - assert sum([len(l) for (id, l) in response_data.items()]) == 34 + assert sum([len(l) for l in response_data.values()]) == 34 response = test_client.get(f"/products/qc?weeks={num_weeks}&final=true") assert response.status_code == 200 response_data = response.json() assert len(response_data) == 4 - assert sum([len(l) for (id, l) in response_data.items()]) == 8 + assert sum([len(l) for l in response_data.values()]) == 8 response = test_client.get( f"/products/qc?weeks={num_weeks}&final=True&seq_level=yes" @@ -102,7 +102,7 @@ def test_get_qc(test_client: TestClient, load_data4well_retrieval): assert response.status_code == 200 response_data = response.json() assert len(response_data) == 4 - assert sum([len(l) for (id, l) in response_data.items()]) == 4 + assert sum([len(l) for l in response_data.values()]) == 4 product_id = "5e91b9246b30c2df4e9f2a2313ce097e93493b0a822e9d9338e32df5d58db585" assert product_id in response_data qc_state = response_data[product_id][0] diff --git a/tests/test_qc_state_retrieval.py b/tests/test_qc_state_retrieval.py index 505d80b..c572225 100644 --- a/tests/test_qc_state_retrieval.py +++ b/tests/test_qc_state_retrieval.py @@ -89,14 +89,14 @@ def test_bulk_retrieval(qcdb_test_session, load_data4well_retrieval): min_num_weeks = int(min_interval.days / 7 - 1) assert min_num_weeks > 2 - # Set the look-back number of weeks to teh period with no records. + # Set the look-back number of weeks to the period with no records. qc_states_dict = get_qc_states(qcdb_test_session, num_weeks=(min_num_weeks - 1)) assert len(qc_states_dict) == 0 # Retrieve all available QC states. qc_states_dict = get_qc_states(qcdb_test_session, num_weeks=max_num_weeks) # Test total number of QcState objects. - assert sum([len(l) for (id, l) in qc_states_dict.items()]) == len(qc_states) + assert sum([len(l) for l in qc_states_dict.values()]) == len(qc_states) # Test number of items in the dictionary. assert len(qc_states_dict) == len( {qc_state.id_seq_product: 1 for qc_state in qc_states} @@ -106,7 +106,7 @@ def test_bulk_retrieval(qcdb_test_session, load_data4well_retrieval): qc_states_dict = get_qc_states( qcdb_test_session, num_weeks=max_num_weeks, final_only=True ) - assert sum([len(l) for (id, l) in qc_states_dict.items()]) == len( + assert sum([len(l) for l in qc_states_dict.values()]) == len( [qc_state for qc_state in qc_states if qc_state.is_preliminary == 0] ) assert {id: len(l) for (id, l) in qc_states_dict.items()} == {