@@ -76,8 +76,7 @@ async def test_includes_termination_reason_in_event_message_when_switching_direc
7676 )
7777
7878
79- class TestFilterPoolInstances :
80- # TODO: Refactor filter_pool_instances to not depend on InstanceModel and simplify tests
79+ class TestFilterInstances :
8180 @pytest .mark .asyncio
8281 @pytest .mark .parametrize ("test_db" , ["sqlite" , "postgres" ], indirect = True )
8382 async def test_returns_all_instances (self , test_db , session : AsyncSession ):
@@ -94,8 +93,8 @@ async def test_returns_all_instances(self, test_db, session: AsyncSession):
9493 backend = BackendType .RUNPOD ,
9594 )
9695 instances = [aws_instance , runpod_instance ]
97- res = instances_services .filter_pool_instances (
98- pool_instances = instances ,
96+ res = instances_services .filter_instances (
97+ instances = instances ,
9998 profile = Profile (name = "test" ),
10099 )
101100 assert res == instances
@@ -116,8 +115,8 @@ async def test_returns_multinode_instances(self, test_db, session: AsyncSession)
116115 backend = BackendType .VASTAI ,
117116 )
118117 instances = [aws_instance , vastai_instance ]
119- res = instances_services .filter_pool_instances (
120- pool_instances = instances ,
118+ res = instances_services .filter_instances (
119+ instances = instances ,
121120 profile = Profile (name = "test" ),
122121 multinode = True ,
123122 )
@@ -146,8 +145,8 @@ async def test_returns_volume_instances(self, test_db, session: AsyncSession):
146145 region = "us" ,
147146 )
148147 instances = [aws_instance , runpod_instance1 , runpod_instance2 ]
149- res = instances_services .filter_pool_instances (
150- pool_instances = instances ,
148+ res = instances_services .filter_instances (
149+ instances = instances ,
151150 profile = Profile (name = "test" ),
152151 volumes = [
153152 [
0 commit comments