Skip to content

Commit 854e513

Browse files
committed
update tests
1 parent cadc9f7 commit 854e513

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

tests/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ def random_string(length: int = 10) -> str:
1616
return "".join(random.choices(string.ascii_lowercase, k=length))
1717

1818

19-
def get_test_email() -> str:
19+
def get_test_email(*, reply_to: bool = False, cc: bool = False) -> str:
20+
if reply_to:
21+
return _get_env_var("TEST_REPLY_TO_EMAIL", "test reply-to email address")
22+
if cc:
23+
return _get_env_var("TEST_CC_EMAIL", "test cc email address")
2024
return _get_env_var("TEST_EMAIL", "test email address")
2125

2226

tests/test_email.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
@pytest.fixture
9-
def email_client() -> Email:
9+
def email() -> Email:
1010
return Contiguity().email
1111

1212

@@ -43,8 +43,8 @@ def test_email_with_optional_fields(email: Email) -> None:
4343
from_="Test Sender",
4444
subject="Test Email with Optional Fields",
4545
body_text="This is a test email with optional fields.",
46-
reply_to="reply@contiguity.co",
47-
cc=["cc@contiguity.co"],
46+
reply_to=get_test_email(reply_to=True),
47+
cc=[get_test_email(cc=True)],
4848
headers={"X-Test-Header": "pytest"},
4949
)
5050

tests/test_imessage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
@pytest.fixture
9-
def imessage_client() -> IMessage:
9+
def imessage() -> IMessage:
1010
return Contiguity().imessage
1111

1212

tests/test_otp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
@pytest.fixture
9-
def otp_client() -> OTP:
9+
def otp() -> OTP:
1010
return Contiguity().otp
1111

1212

tests/test_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
@pytest.fixture
9-
def text_client() -> Text:
9+
def text() -> Text:
1010
return Contiguity().text
1111

1212

tests/test_whatsapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
@pytest.fixture
9-
def whatsapp_client() -> WhatsApp:
9+
def whatsapp() -> WhatsApp:
1010
return Contiguity().whatsapp
1111

1212

0 commit comments

Comments
 (0)