From 57fbf35297b2b5289056fb97e6bb7a6f2e75d37e Mon Sep 17 00:00:00 2001 From: Max Marrone Date: Wed, 4 Dec 2024 10:47:04 -0500 Subject: [PATCH] test(api): Point out old `opentrons.protocol_engine.state` test conventions more consistently (#17018) --- ...le_area_store.py => test_addressable_area_store_old.py} | 4 ++-- ...able_area_view.py => test_addressable_area_view_old.py} | 4 ++-- .../protocol_engine/state/test_command_store_old.py | 3 ++- .../protocol_engine/state/test_command_view_old.py | 3 ++- .../{test_labware_store.py => test_labware_store_old.py} | 7 ++++++- .../{test_labware_view.py => test_labware_view_old.py} | 7 ++++++- ...iquid_class_store.py => test_liquid_class_store_old.py} | 7 ++++++- ..._liquid_class_view.py => test_liquid_class_view_old.py} | 7 ++++++- .../{test_liquid_store.py => test_liquid_store_old.py} | 7 ++++++- .../state/{test_liquid_view.py => test_liquid_view_old.py} | 7 ++++++- .../{test_module_store.py => test_module_store_old.py} | 7 ++++++- .../state/{test_module_view.py => test_module_view_old.py} | 7 ++++++- .../{test_pipette_store.py => test_pipette_store_old.py} | 7 ++++++- .../{test_pipette_view.py => test_pipette_view_old.py} | 7 ++++++- .../state/{test_well_store.py => test_well_store_old.py} | 7 ++++++- .../state/{test_well_view.py => test_well_view_old.py} | 7 ++++++- 16 files changed, 80 insertions(+), 18 deletions(-) rename api/tests/opentrons/protocol_engine/state/{test_addressable_area_store.py => test_addressable_area_store_old.py} (98%) rename api/tests/opentrons/protocol_engine/state/{test_addressable_area_view.py => test_addressable_area_view_old.py} (98%) rename api/tests/opentrons/protocol_engine/state/{test_labware_store.py => test_labware_store_old.py} (97%) rename api/tests/opentrons/protocol_engine/state/{test_labware_view.py => test_labware_view_old.py} (99%) rename api/tests/opentrons/protocol_engine/state/{test_liquid_class_store.py => test_liquid_class_store_old.py} (88%) rename api/tests/opentrons/protocol_engine/state/{test_liquid_class_view.py => test_liquid_class_view_old.py} (88%) rename api/tests/opentrons/protocol_engine/state/{test_liquid_store.py => test_liquid_store_old.py} (75%) rename api/tests/opentrons/protocol_engine/state/{test_liquid_view.py => test_liquid_view_old.py} (87%) rename api/tests/opentrons/protocol_engine/state/{test_module_store.py => test_module_store_old.py} (99%) rename api/tests/opentrons/protocol_engine/state/{test_module_view.py => test_module_view_old.py} (99%) rename api/tests/opentrons/protocol_engine/state/{test_pipette_store.py => test_pipette_store_old.py} (99%) rename api/tests/opentrons/protocol_engine/state/{test_pipette_view.py => test_pipette_view_old.py} (99%) rename api/tests/opentrons/protocol_engine/state/{test_well_store.py => test_well_store_old.py} (97%) rename api/tests/opentrons/protocol_engine/state/{test_well_view.py => test_well_view_old.py} (89%) diff --git a/api/tests/opentrons/protocol_engine/state/test_addressable_area_store.py b/api/tests/opentrons/protocol_engine/state/test_addressable_area_store_old.py similarity index 98% rename from api/tests/opentrons/protocol_engine/state/test_addressable_area_store.py rename to api/tests/opentrons/protocol_engine/state/test_addressable_area_store_old.py index 44c72e38e86..b9e3e8f4e78 100644 --- a/api/tests/opentrons/protocol_engine/state/test_addressable_area_store.py +++ b/api/tests/opentrons/protocol_engine/state/test_addressable_area_store_old.py @@ -1,8 +1,8 @@ """Addressable area state store tests. DEPRECATED: Testing AddressableAreaStore independently of AddressableAreaView is no -longer helpful. Add new tests to test_addressable_area_state.py, where they can be -tested together. +longer helpful. Try to add new tests to test_addressable_area_state.py, where they can be +tested together, treating AddressableAreaState as a private implementation detail. """ import pytest diff --git a/api/tests/opentrons/protocol_engine/state/test_addressable_area_view.py b/api/tests/opentrons/protocol_engine/state/test_addressable_area_view_old.py similarity index 98% rename from api/tests/opentrons/protocol_engine/state/test_addressable_area_view.py rename to api/tests/opentrons/protocol_engine/state/test_addressable_area_view_old.py index fc57cb73521..5aa157c59db 100644 --- a/api/tests/opentrons/protocol_engine/state/test_addressable_area_view.py +++ b/api/tests/opentrons/protocol_engine/state/test_addressable_area_view_old.py @@ -1,8 +1,8 @@ """Addressable area state view tests. DEPRECATED: Testing AddressableAreaView independently of AddressableAreaStore is no -longer helpful. Add new tests to test_addressable_area_state.py, where they can be -tested together. +longer helpful. Try to add new tests to test_addressable_area_state.py, where they can be +tested together, treating AddressableAreaState as a private implementation detail. """ import inspect diff --git a/api/tests/opentrons/protocol_engine/state/test_command_store_old.py b/api/tests/opentrons/protocol_engine/state/test_command_store_old.py index 881719ba7ad..a9022803bcf 100644 --- a/api/tests/opentrons/protocol_engine/state/test_command_store_old.py +++ b/api/tests/opentrons/protocol_engine/state/test_command_store_old.py @@ -1,7 +1,8 @@ """Tests for CommandStore. DEPRECATED: Testing CommandStore independently of CommandView is no longer helpful. -Add new tests to test_command_state.py, where they can be tested together. +Try to add new tests to test_command_state.py, where they can be tested together, +treating CommandState as a private implementation detail. """ diff --git a/api/tests/opentrons/protocol_engine/state/test_command_view_old.py b/api/tests/opentrons/protocol_engine/state/test_command_view_old.py index 84b4a8606f6..de242d83f51 100644 --- a/api/tests/opentrons/protocol_engine/state/test_command_view_old.py +++ b/api/tests/opentrons/protocol_engine/state/test_command_view_old.py @@ -1,7 +1,8 @@ """Tests for CommandView. DEPRECATED: Testing CommandView independently of CommandStore is no longer helpful. -Add new tests to test_command_state.py, where they can be tested together. +Try to add new tests to test_command_state.py, where they can be tested together, +treating CommandState as a private implementation detail. """ diff --git a/api/tests/opentrons/protocol_engine/state/test_labware_store.py b/api/tests/opentrons/protocol_engine/state/test_labware_store_old.py similarity index 97% rename from api/tests/opentrons/protocol_engine/state/test_labware_store.py rename to api/tests/opentrons/protocol_engine/state/test_labware_store_old.py index 47150ec425f..3b539df58e3 100644 --- a/api/tests/opentrons/protocol_engine/state/test_labware_store.py +++ b/api/tests/opentrons/protocol_engine/state/test_labware_store_old.py @@ -1,4 +1,9 @@ -"""Labware state store tests.""" +"""Labware state store tests. + +DEPRECATED: Testing LabwareStore independently of LabwareView is no +longer helpful. Try to add new tests to test_labware_state.py, where they can be +tested together, treating LabwareState as a private implementation detail. +""" from typing import Optional from opentrons.protocol_engine.state import update_types import pytest diff --git a/api/tests/opentrons/protocol_engine/state/test_labware_view.py b/api/tests/opentrons/protocol_engine/state/test_labware_view_old.py similarity index 99% rename from api/tests/opentrons/protocol_engine/state/test_labware_view.py rename to api/tests/opentrons/protocol_engine/state/test_labware_view_old.py index 56113aff419..0b6886040c6 100644 --- a/api/tests/opentrons/protocol_engine/state/test_labware_view.py +++ b/api/tests/opentrons/protocol_engine/state/test_labware_view_old.py @@ -1,4 +1,9 @@ -"""Labware state store tests.""" +"""Labware state store tests. + +DEPRECATED: Testing LabwareView independently of LabwareStore is no +longer helpful. Try to add new tests to test_labware_state.py, where they can be +tested together, treating LabwareState as a private implementation detail. +""" import pytest from datetime import datetime from typing import Dict, Optional, cast, ContextManager, Any, Union, NamedTuple, List diff --git a/api/tests/opentrons/protocol_engine/state/test_liquid_class_store.py b/api/tests/opentrons/protocol_engine/state/test_liquid_class_store_old.py similarity index 88% rename from api/tests/opentrons/protocol_engine/state/test_liquid_class_store.py rename to api/tests/opentrons/protocol_engine/state/test_liquid_class_store_old.py index aac74fd6133..57397ec61cb 100644 --- a/api/tests/opentrons/protocol_engine/state/test_liquid_class_store.py +++ b/api/tests/opentrons/protocol_engine/state/test_liquid_class_store_old.py @@ -1,4 +1,9 @@ -"""Liquid state store tests.""" +"""Liquid state store tests. + +DEPRECATED: Testing LiquidClassStore independently of LiquidClassView is no +longer helpful. Try to add new tests to test_liquid_class_state.py, where they can be +tested together, treating LiquidClassState as a private implementation detail. +""" import pytest from opentrons_shared_data.liquid_classes.liquid_class_definition import ( diff --git a/api/tests/opentrons/protocol_engine/state/test_liquid_class_view.py b/api/tests/opentrons/protocol_engine/state/test_liquid_class_view_old.py similarity index 88% rename from api/tests/opentrons/protocol_engine/state/test_liquid_class_view.py rename to api/tests/opentrons/protocol_engine/state/test_liquid_class_view_old.py index d80f40a5d0c..f28438b3756 100644 --- a/api/tests/opentrons/protocol_engine/state/test_liquid_class_view.py +++ b/api/tests/opentrons/protocol_engine/state/test_liquid_class_view_old.py @@ -1,4 +1,9 @@ -"""Liquid view tests.""" +"""Liquid view tests. + +DEPRECATED: Testing LiquidClassView independently of LiquidClassStore is no +longer helpful. Try to add new tests to test_liquid_class_state.py, where they can be +tested together, treating LiquidClassState as a private implementation detail. +""" import pytest from opentrons_shared_data.liquid_classes.liquid_class_definition import ( diff --git a/api/tests/opentrons/protocol_engine/state/test_liquid_store.py b/api/tests/opentrons/protocol_engine/state/test_liquid_store_old.py similarity index 75% rename from api/tests/opentrons/protocol_engine/state/test_liquid_store.py rename to api/tests/opentrons/protocol_engine/state/test_liquid_store_old.py index fe21b43193e..18417fe7570 100644 --- a/api/tests/opentrons/protocol_engine/state/test_liquid_store.py +++ b/api/tests/opentrons/protocol_engine/state/test_liquid_store_old.py @@ -1,4 +1,9 @@ -"""Liquid state store tests.""" +"""Liquid state store tests. + +DEPRECATED: Testing LiquidStore independently of LiquidView is no longer helpful. +Try to add new tests to test_liquid_state.py, where they can be tested together, +treating LiquidState as a private implementation detail. +""" import pytest from opentrons.protocol_engine.state.liquids import LiquidStore from opentrons.protocol_engine import Liquid diff --git a/api/tests/opentrons/protocol_engine/state/test_liquid_view.py b/api/tests/opentrons/protocol_engine/state/test_liquid_view_old.py similarity index 87% rename from api/tests/opentrons/protocol_engine/state/test_liquid_view.py rename to api/tests/opentrons/protocol_engine/state/test_liquid_view_old.py index db1e6f274a1..92a9a2bd667 100644 --- a/api/tests/opentrons/protocol_engine/state/test_liquid_view.py +++ b/api/tests/opentrons/protocol_engine/state/test_liquid_view_old.py @@ -1,4 +1,9 @@ -"""Liquid view tests.""" +"""Liquid view tests. + +DEPRECATED: Testing LiquidView independently of LiquidStore is no longer helpful. +Try to add new tests to test_liquid_state.py, where they can be tested together, +treating LiquidState as a private implementation detail. +""" import pytest from opentrons.protocol_engine.state.liquids import LiquidState, LiquidView diff --git a/api/tests/opentrons/protocol_engine/state/test_module_store.py b/api/tests/opentrons/protocol_engine/state/test_module_store_old.py similarity index 99% rename from api/tests/opentrons/protocol_engine/state/test_module_store.py rename to api/tests/opentrons/protocol_engine/state/test_module_store_old.py index 832713ed0a4..e4ab52ebaf8 100644 --- a/api/tests/opentrons/protocol_engine/state/test_module_store.py +++ b/api/tests/opentrons/protocol_engine/state/test_module_store_old.py @@ -1,4 +1,9 @@ -"""Module state store tests.""" +"""Module state store tests. + +DEPRECATED: Testing ModuleStore independently of ModuleView is no longer helpful. +Try to add new tests to test_module_state.py, where they can be tested together, +treating ModuleState as a private implementation detail. +""" from typing import List, Set, cast, Dict, Optional import pytest diff --git a/api/tests/opentrons/protocol_engine/state/test_module_view.py b/api/tests/opentrons/protocol_engine/state/test_module_view_old.py similarity index 99% rename from api/tests/opentrons/protocol_engine/state/test_module_view.py rename to api/tests/opentrons/protocol_engine/state/test_module_view_old.py index 66152a57240..3902eedc76f 100644 --- a/api/tests/opentrons/protocol_engine/state/test_module_view.py +++ b/api/tests/opentrons/protocol_engine/state/test_module_view_old.py @@ -1,4 +1,9 @@ -"""Tests for module state accessors in the protocol engine state store.""" +"""Tests for module state accessors in the protocol engine state store. + +DEPRECATED: Testing ModuleView independently of ModuleView is no longer helpful. +Try to add new tests to test_module_state.py, where they can be tested together, +treating ModuleState as a private implementation detail. +""" import pytest from math import isclose from pytest_lazyfixture import lazy_fixture # type: ignore[import-untyped] diff --git a/api/tests/opentrons/protocol_engine/state/test_pipette_store.py b/api/tests/opentrons/protocol_engine/state/test_pipette_store_old.py similarity index 99% rename from api/tests/opentrons/protocol_engine/state/test_pipette_store.py rename to api/tests/opentrons/protocol_engine/state/test_pipette_store_old.py index e88f7886b81..b88844bb53d 100644 --- a/api/tests/opentrons/protocol_engine/state/test_pipette_store.py +++ b/api/tests/opentrons/protocol_engine/state/test_pipette_store_old.py @@ -1,4 +1,9 @@ -"""Tests for pipette state changes in the protocol_engine state store.""" +"""Tests for pipette state changes in the protocol_engine state store. + +DEPRECATED: Testing PipetteStore independently of PipetteView is no longer helpful. +Try to add new tests to test_pipette_state.py, where they can be tested together, +treating PipetteState as a private implementation detail. +""" import pytest from opentrons_shared_data.pipette.types import PipetteNameType diff --git a/api/tests/opentrons/protocol_engine/state/test_pipette_view.py b/api/tests/opentrons/protocol_engine/state/test_pipette_view_old.py similarity index 99% rename from api/tests/opentrons/protocol_engine/state/test_pipette_view.py rename to api/tests/opentrons/protocol_engine/state/test_pipette_view_old.py index c3addf9f1d7..ce07e5fda8e 100644 --- a/api/tests/opentrons/protocol_engine/state/test_pipette_view.py +++ b/api/tests/opentrons/protocol_engine/state/test_pipette_view_old.py @@ -1,4 +1,9 @@ -"""Tests for pipette state accessors in the protocol_engine state store.""" +"""Tests for pipette state accessors in the protocol_engine state store. + +DEPRECATED: Testing PipetteView independently of PipetteStore is no longer helpful. +Try to add new tests to test_pipette_state.py, where they can be tested together, +treating PipetteState as a private implementation detail. +""" from collections import OrderedDict from typing import cast, Dict, List, Optional, Tuple, NamedTuple diff --git a/api/tests/opentrons/protocol_engine/state/test_well_store.py b/api/tests/opentrons/protocol_engine/state/test_well_store_old.py similarity index 97% rename from api/tests/opentrons/protocol_engine/state/test_well_store.py rename to api/tests/opentrons/protocol_engine/state/test_well_store_old.py index 54e08a45e74..51142afd9da 100644 --- a/api/tests/opentrons/protocol_engine/state/test_well_store.py +++ b/api/tests/opentrons/protocol_engine/state/test_well_store_old.py @@ -1,4 +1,9 @@ -"""Well state store tests.""" +"""Well state store tests. + +DEPRECATED: Testing WellStore independently of WellView is no longer helpful. +Try to add new tests to well_state.py, where they can be tested together, +treating WellState as a private implementation detail. +""" import pytest from datetime import datetime diff --git a/api/tests/opentrons/protocol_engine/state/test_well_view.py b/api/tests/opentrons/protocol_engine/state/test_well_view_old.py similarity index 89% rename from api/tests/opentrons/protocol_engine/state/test_well_view.py rename to api/tests/opentrons/protocol_engine/state/test_well_view_old.py index 5025e4ee93e..9ced4db9df0 100644 --- a/api/tests/opentrons/protocol_engine/state/test_well_view.py +++ b/api/tests/opentrons/protocol_engine/state/test_well_view_old.py @@ -1,4 +1,9 @@ -"""Well view tests.""" +"""Well view tests. + +DEPRECATED: Testing WellView independently of WellStore is no longer helpful. +Try to add new tests to test_well_state.py, where they can be tested together, +treating WellState as a private implementation detail. +""" from datetime import datetime from opentrons.protocol_engine.types import ( LoadedVolumeInfo,