-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_async_batches.py
More file actions
42 lines (23 loc) · 1.33 KB
/
test_async_batches.py
File metadata and controls
42 lines (23 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import pytest
from mpt_api_client.rql.query_builder import RQLQuery
@pytest.mark.skip(reason="Batches can not be deleted")
async def test_create_batch(async_batch_service, batch_data):
result = await async_batch_service.create(batch_data)
assert result is not None
async def test_get_batch(async_batch_service, batch_id):
result = await async_batch_service.get(batch_id, select=["attachments"])
assert result.id == batch_id
async def test_iterate_and_filter(async_batch_service, batch_id):
batches = [batch async for batch in async_batch_service.filter(RQLQuery(id=batch_id)).iterate()]
assert len(batches) == 1
assert batches[0].id == batch_id
@pytest.mark.skip(reason="Batches can not be deleted")
async def test_create_batch_with_file(async_batch_service, batch_data, logo_fd):
result = await async_batch_service.create(batch_data, file=logo_fd)
assert result is not None
async def test_download_attachment(async_batch_service, batch_id, batch_attachment_id):
result = await async_batch_service.download_attachment(batch_id, batch_attachment_id)
assert result.filename == "logo.png"
async def test_get_attachment(async_batch_service, batch_id, batch_attachment_id):
result = await async_batch_service.get_attachment(batch_id, batch_attachment_id)
assert result.id == batch_attachment_id