From 98df17371dc1d3333d4bb967be40e9caae6eadc9 Mon Sep 17 00:00:00 2001 From: Yam Marcovitz Date: Tue, 24 Dec 2024 12:25:33 +0000 Subject: [PATCH] Remove redundant conftest.py --- tests/core/stable/engines/alpha/conftest.py | 86 --------------------- 1 file changed, 86 deletions(-) delete mode 100644 tests/core/stable/engines/alpha/conftest.py diff --git a/tests/core/stable/engines/alpha/conftest.py b/tests/core/stable/engines/alpha/conftest.py deleted file mode 100644 index 971993611..000000000 --- a/tests/core/stable/engines/alpha/conftest.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 2024 Emcie Co Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from datetime import datetime, timezone -from lagom import Container -from pytest import fixture - -from parlant.core.agents import Agent, AgentId, AgentStore -from parlant.core.customers import Customer, CustomerId, CustomerStore -from parlant.core.sessions import Session, SessionStore - -from tests.core.common.utils import ContextOfTest -from tests.test_utilities import SyncAwaiter - - -@fixture -def context(sync_await: SyncAwaiter, container: Container) -> ContextOfTest: - return ContextOfTest( - sync_await, - container, - events=list(), - guidelines=dict(), - guideline_propositions=dict(), - tools=dict(), - ) - - -@fixture -def agent(context: ContextOfTest) -> Agent: - store = context.container[AgentStore] - agent = context.sync_await( - store.create_agent( - name="test-agent", - ), - ) - return agent - - -@fixture -def agent_id(agent: Agent) -> AgentId: - return agent.id - - -@fixture -def customer(context: ContextOfTest) -> Customer: - store = context.container[CustomerStore] - customer = context.sync_await( - store.create_customer( - name="Test Customer", - extra={"email": "test@customer.com"}, - ), - ) - return customer - - -@fixture -def customer_id(customer: Customer) -> CustomerId: - return customer.id - - -@fixture -def new_session( - context: ContextOfTest, - agent_id: AgentId, - customer_id: CustomerId, -) -> Session: - store = context.container[SessionStore] - utc_now = datetime.now(timezone.utc) - return context.sync_await( - store.create_session( - creation_utc=utc_now, - customer_id=customer_id, - agent_id=agent_id, - ) - )