Skip to content

Commit 820ea99

Browse files
committed
fix
1 parent 9d6cfc6 commit 820ea99

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

packages/service-library/tests/rabbitmq/test_rabbitmq_rpc_interfaces_async_jobs.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ def method_name(faker: Faker) -> RPCMethodName:
3535

3636

3737
@pytest.fixture
38-
def job_id_data(faker: Faker) -> AsyncJobFilter:
38+
def job_filter(faker: Faker) -> AsyncJobFilter:
3939
return AsyncJobFilter(
4040
user_id=faker.pyint(min_value=1),
4141
product_name=faker.word(),
42+
client_name="PYTEST_CLIENT_NAME",
4243
)
4344

4445

@@ -143,7 +144,7 @@ async def test_async_jobs_methods(
143144
async_job_rpc_server: RabbitMQRPCClient,
144145
rpc_client: RabbitMQRPCClient,
145146
namespace: RPCNamespace,
146-
job_id_data: AsyncJobFilter,
147+
job_filter: AsyncJobFilter,
147148
job_id: AsyncJobId,
148149
method: str,
149150
):
@@ -155,7 +156,7 @@ async def test_async_jobs_methods(
155156
rpc_client,
156157
rpc_namespace=namespace,
157158
job_id=job_id,
158-
job_id_data=job_id_data,
159+
job_id_data=job_filter,
159160
)
160161

161162

@@ -164,13 +165,13 @@ async def test_list_jobs(
164165
rpc_client: RabbitMQRPCClient,
165166
namespace: RPCNamespace,
166167
method_name: RPCMethodName,
167-
job_id_data: AsyncJobFilter,
168+
job_filter: AsyncJobFilter,
168169
):
169170
await list_jobs(
170171
rpc_client,
171172
rpc_namespace=namespace,
172173
filter_="",
173-
job_filter=job_id_data,
174+
job_filter=job_filter,
174175
)
175176

176177

@@ -179,28 +180,28 @@ async def test_submit(
179180
rpc_client: RabbitMQRPCClient,
180181
namespace: RPCNamespace,
181182
method_name: RPCMethodName,
182-
job_id_data: AsyncJobFilter,
183+
job_filter: AsyncJobFilter,
183184
):
184185
await submit(
185186
rpc_client,
186187
rpc_namespace=namespace,
187188
method_name=method_name,
188-
job_filter=job_id_data,
189+
job_filter=job_filter,
189190
)
190191

191192

192193
async def test_submit_with_invalid_method_name(
193194
async_job_rpc_server: RabbitMQRPCClient,
194195
rpc_client: RabbitMQRPCClient,
195196
namespace: RPCNamespace,
196-
job_id_data: AsyncJobFilter,
197+
job_filter: AsyncJobFilter,
197198
):
198199
with pytest.raises(RemoteMethodNotRegisteredError):
199200
await submit(
200201
rpc_client,
201202
rpc_namespace=namespace,
202203
method_name=RPCMethodName("invalid_method_name"),
203-
job_filter=job_id_data,
204+
job_filter=job_filter,
204205
)
205206

206207

@@ -209,14 +210,14 @@ async def test_submit_and_wait_properly_timesout(
209210
rpc_client: RabbitMQRPCClient,
210211
namespace: RPCNamespace,
211212
method_name: RPCMethodName,
212-
job_id_data: AsyncJobFilter,
213+
job_filter: AsyncJobFilter,
213214
):
214215
with pytest.raises(TimeoutError): # noqa: PT012
215216
async for _job_composed_result in submit_and_wait(
216217
rpc_client,
217218
rpc_namespace=namespace,
218219
method_name=method_name,
219-
job_filter=job_id_data,
220+
job_filter=job_filter,
220221
client_timeout=datetime.timedelta(seconds=0.1),
221222
):
222223
pass
@@ -227,13 +228,13 @@ async def test_submit_and_wait(
227228
rpc_client: RabbitMQRPCClient,
228229
namespace: RPCNamespace,
229230
method_name: RPCMethodName,
230-
job_id_data: AsyncJobFilter,
231+
job_filter: AsyncJobFilter,
231232
):
232233
async for job_composed_result in submit_and_wait(
233234
rpc_client,
234235
rpc_namespace=namespace,
235236
method_name=method_name,
236-
job_filter=job_id_data,
237+
job_filter=job_filter,
237238
client_timeout=datetime.timedelta(seconds=10),
238239
):
239240
if not job_composed_result.done:
@@ -245,6 +246,6 @@ async def test_submit_and_wait(
245246
result={
246247
"data": None,
247248
"job_id": job_composed_result.status.job_id,
248-
"job_id_data": job_id_data,
249+
"job_id_data": job_filter,
249250
}
250251
)

0 commit comments

Comments
 (0)