This commit is contained in:
Kenneth Kehl
2023-08-29 14:54:30 -07:00
parent 19dcd7a48b
commit 1ecb747c6d
588 changed files with 34100 additions and 23589 deletions

View File

@@ -8,7 +8,7 @@ def fake_client(notify_api):
class FakeSmsClient(SmsClient):
@property
def name(self):
return 'fake'
return "fake"
fake_client = FakeSmsClient()
# fake_client.init_app(notify_api)
@@ -16,31 +16,35 @@ def fake_client(notify_api):
def test_send_sms(fake_client, mocker):
mock_send = mocker.patch.object(fake_client, 'send_sms')
mock_send = mocker.patch.object(fake_client, "send_sms")
fake_client.send_sms(
to='to',
content='content',
reference='reference',
to="to",
content="content",
reference="reference",
international=False,
sender='testing',
sender="testing",
)
mock_send.assert_called_with(
to='to', content='content', reference='reference', international=False, sender='testing'
to="to",
content="content",
reference="reference",
international=False,
sender="testing",
)
def test_send_sms_error(fake_client, mocker):
mocker.patch.object(
fake_client, 'send_sms', side_effect=SmsClientResponseException('error')
fake_client, "send_sms", side_effect=SmsClientResponseException("error")
)
with pytest.raises(SmsClientResponseException):
fake_client.send_sms(
to='to',
content='content',
reference='reference',
to="to",
content="content",
reference="reference",
international=False,
sender=None,
)