From ec82fccf3aedbc76c9828e6282118934145adb7b Mon Sep 17 00:00:00 2001 From: Rodrigo Brandao Date: Tue, 4 Aug 2026 13:16:54 -0700 Subject: [PATCH] Fixing Select.expect implementation to fit with ExpectBase refactor --- .../microsoft_agents/testing/core/fluent/select.py | 6 +++--- .../tests/core/fluent/test_select.py | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/select.py b/dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/select.py index 99e16a51..e3e867a1 100644 --- a/dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/select.py +++ b/dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/select.py @@ -14,7 +14,7 @@ from pydantic import BaseModel from .backend import ModelPredicate, DictionaryTransform -from .expect import Expect +from .expect import ExpectBase ModelT = TypeVar("ModelT", bound=dict | BaseModel) @@ -49,9 +49,9 @@ def __init__( ) -> None: self._items = list(items) - def expect(self) -> Expect: + def expect(self) -> ExpectBase[ModelT]: """Get an Expect instance for assertions on the current selection.""" - return Expect(self._items) + return ExpectBase[ModelT](self._items) def _child(self, items: Sequence[ModelT]) -> Self: """Create a child Select with new items, inheriting selector and quantifier.""" diff --git a/dev/microsoft-agents-testing/tests/core/fluent/test_select.py b/dev/microsoft-agents-testing/tests/core/fluent/test_select.py index 5d5495e9..c4eb61e4 100644 --- a/dev/microsoft-agents-testing/tests/core/fluent/test_select.py +++ b/dev/microsoft-agents-testing/tests/core/fluent/test_select.py @@ -51,12 +51,6 @@ def test_init_with_generator(self): class TestSelectExpect: """Tests for the expect() method.""" - def test_expect_returns_expect_instance(self): - """expect() returns an Expect instance.""" - select = Select([{"name": "a"}]) - result = select.expect() - assert isinstance(result, Expect) - def test_expect_with_correct_items(self): """expect() passes the current items to Expect.""" items = [{"name": "a"}, {"name": "b"}]