From 6481b147fc8136a889fefc4c60838c2f6a6d42f5 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Fri, 21 Jan 2022 16:03:39 -0800 Subject: [PATCH] style and other fixes Signed-off-by: Scott Murray --- ...omEditorComponents_EntityReferenceAdded.py | 38 +++++++++---------- .../editor_entity_utils.py | 2 +- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py index 7f15702199..66efab9e01 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_EntityReferenceAdded.py @@ -86,9 +86,9 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): 7) Add item to 'EntityIdReferences' 8) Update item in 'EntityIdReferences' 9) Remove item from 'EntityIdReferences' - 10) Rest the container property then put one entity reference back for further tests + 10) Reset the container property then put one entity reference back for further tests 11) Remove component - 12) Undo component remove + 12) UNDO component remove 13) Enter/Exit game mode. 14) Test IsHidden. 15) Test IsVisible. @@ -160,55 +160,53 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): AtomComponentProperties.entity_reference('EntityIdReferences'))) # 6. Append item to 'EntityIdReferences' - entity_reference_component.append_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - test_1.id) + entity_reference_component.append_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), test_1.id) Report.result( Tests.container_append, entity_reference_component.get_container_item( AtomComponentProperties.entity_reference('EntityIdReferences'), 0) == test_1.id) # 7. Add item to 'EntityIdReferences' - entity_reference_component.add_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - 1, test_1.id) + entity_reference_component.add_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), 1, test_1.id) Report.result( Tests.container_add, entity_reference_component.get_container_count( - AtomComponentProperties.entity_reference('EntityIdReferences')) == 2 - ) + AtomComponentProperties.entity_reference('EntityIdReferences')) == 2) # 8. Update item in 'EntityIdReferences' - entity_reference_component.update_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - 1, test_2.id) + entity_reference_component.update_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), 1, test_2.id) Report.result( Tests.container_update, entity_reference_component.get_container_item( AtomComponentProperties.entity_reference('EntityIdReferences'), 1) == test_2.id) # 9. Remove item from 'EntityIdReferences' - entity_reference_component.append_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - test_3.id) + entity_reference_component.append_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), test_3.id) count_before = entity_reference_component.get_container_count( AtomComponentProperties.entity_reference('EntityIdReferences')) - entity_reference_component.remove_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - 1) + entity_reference_component.remove_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), 1) count_after = entity_reference_component.get_container_count( AtomComponentProperties.entity_reference('EntityIdReferences')) Report.result( Tests.container_remove, ((count_before == 3) and (count_after == 2) and (entity_reference_component.get_container_item( - AtomComponentProperties.entity_reference('EntityIdReferences'), 1) == test_3.id)) - ) + AtomComponentProperties.entity_reference('EntityIdReferences'), 1) == test_3.id))) - # 10. Rest the container property then put one entity reference back for further tests + # 10. Reset the container property then put one entity reference back for further tests entity_reference_component.reset_container(AtomComponentProperties.entity_reference('EntityIdReferences')) general.idle_wait_frames(1) Report.result( Tests.container_reset, entity_reference_component.get_container_count( AtomComponentProperties.entity_reference('EntityIdReferences')) == 0) - entity_reference_component.append_container_item(AtomComponentProperties.entity_reference('EntityIdReferences'), - test_1.id) + entity_reference_component.append_container_item( + AtomComponentProperties.entity_reference('EntityIdReferences'), test_1.id) # 11. Remove component entity_reference_entity.remove_component(AtomComponentProperties.entity_reference()) @@ -216,7 +214,7 @@ def AtomEditorComponents_EntityReference_AddedToEntity(): Report.result(Tests.entity_reference_component_removed, not entity_reference_entity.has_component( AtomComponentProperties.entity_reference())) - # 12. Undo component remove + # 12. UNDO component remove general.undo() general.idle_wait_frames(1) Report.result(Tests.entity_reference_component, entity_reference_entity.has_component( diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index f19bf540a9..d8d4a77a65 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -477,7 +477,7 @@ class EditorEntity: remove_success = editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", component_ids) assert ( remove_success - ), f"Failure: could not remove component from '{self.get_name()}'" + ), f"Failure: could not remove component from entity '{self.get_name()}'" def get_components_of_type(self, component_names: list) -> List[EditorComponent]: """