-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
41 lines (30 loc) · 978 Bytes
/
conftest.py
File metadata and controls
41 lines (30 loc) · 978 Bytes
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
import pytest
from tests.e2e.helper import (
async_create_fixture_resource_and_delete,
create_fixture_resource_and_delete,
)
@pytest.fixture
def contact_data(short_uuid):
return {
"name": "E2E delete me",
"firstName": "Will",
"lastName": "Smith",
"email": f"{short_uuid}@example.com",
"optOuts": [],
}
@pytest.fixture
def created_contact(mpt_ops, contact_data):
service = mpt_ops.notifications.contacts
with create_fixture_resource_and_delete(service, contact_data) as contact:
yield contact
@pytest.fixture
async def async_created_contact(async_mpt_ops, contact_data):
service = async_mpt_ops.notifications.contacts
async with async_create_fixture_resource_and_delete(service, contact_data) as contact:
yield contact
@pytest.fixture
def created_contact_id(created_contact):
return created_contact.id
@pytest.fixture
def invalid_contact_id():
return "CON-0000-0000-0000"