Skip to content

Commit c20f85d

Browse files
committed
ticket number unit tests
1 parent 8716f90 commit c20f85d

File tree

6 files changed

+11
-17
lines changed

6 files changed

+11
-17
lines changed

test/unit/api/test_toll_free_verification_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import unittest
1717
from datetime import datetime
18-
from uuid import UUID
1918

2019
from hamcrest import *
2120
from test.utils.env_variables import *
@@ -144,7 +143,7 @@ def test_get_toll_free_verification_status(self) -> None:
144143
assert_that(response.data, instance_of(TfvStatus))
145144
assert_that(response.data.phone_number, instance_of(str))
146145
assert_that(response.data.status, is_in(TfvStatusEnum))
147-
assert_that(response.data.internal_ticket_number, instance_of(UUID))
146+
assert_that(response.data.internal_ticket_number, instance_of(str))
148147
assert_that(response.data.decline_reason_description, instance_of(str))
149148
assert_that(response.data.resubmit_allowed, instance_of(bool))
150149
assert_that(response.data.created_date_time, instance_of(datetime))

test/unit/models/test_blocked_webhook.py

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

1515

1616
import unittest
17-
from uuid import UUID
1817

1918
from bandwidth.models.blocked_webhook import BlockedWebhook
2019

@@ -39,7 +38,7 @@ def make_instance(self, include_optional) -> BlockedWebhook:
3938
account_id = '1234567',
4039
phone_number = '+18005555555',
4140
status = 'VERIFIED',
42-
internal_ticket_number = UUID('acde070d-8c4c-4f0d-9d8a-162843c10333'),
41+
internal_ticket_number = 'acde070d-8c4c-4f0d-9d8a-162843c10333',
4342
blocked = True,
4443
blocked_reason = 'Toll-free number was used to send spam messages'
4544
)
@@ -55,7 +54,7 @@ def testBlockedWebhook(self):
5554
assert instance.account_id == '1234567'
5655
assert instance.phone_number == '+18005555555'
5756
assert instance.status == 'VERIFIED'
58-
assert instance.internal_ticket_number == UUID('acde070d-8c4c-4f0d-9d8a-162843c10333')
57+
assert instance.internal_ticket_number == 'acde070d-8c4c-4f0d-9d8a-162843c10333'
5958
assert instance.blocked == True
6059
assert instance.blocked_reason == 'Toll-free number was used to send spam messages'
6160

test/unit/models/test_failure_webhook.py

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

1515

1616
import unittest
17-
from uuid import UUID
1817

1918
from bandwidth.models.failure_webhook import FailureWebhook
2019

@@ -41,7 +40,7 @@ def make_instance(self, include_optional) -> FailureWebhook:
4140
errors = [
4241
'optInWorkflowImageURLs: Entries must be a valid array of objects.'
4342
],
44-
internal_ticket_number = UUID('acde070d-8c4c-4f0d-9d8a-162843c10333')
43+
internal_ticket_number = 'acde070d-8c4c-4f0d-9d8a-162843c10333'
4544
)
4645
else:
4746
return FailureWebhook(
@@ -59,7 +58,7 @@ def testFailureWebhook(self):
5958
assert isinstance(instance.errors, list)
6059
assert len(instance.errors) == 1
6160
assert instance.errors[0] == 'optInWorkflowImageURLs: Entries must be a valid array of objects.'
62-
assert instance.internal_ticket_number == UUID('acde070d-8c4c-4f0d-9d8a-162843c10333')
61+
assert instance.internal_ticket_number == 'acde070d-8c4c-4f0d-9d8a-162843c10333'
6362

6463
if __name__ == '__main__':
6564
unittest.main()

test/unit/models/test_tfv_status.py

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

1616
import unittest
1717
from datetime import datetime
18-
from uuid import UUID
1918

2019
from bandwidth.models.tfv_status import TfvStatus
2120
from bandwidth.models.tfv_submission_info import TfvSubmissionInfo
@@ -41,7 +40,7 @@ def make_instance(self, include_optional) -> TfvStatus:
4140
return TfvStatus(
4241
phone_number = '+18005555555',
4342
status = 'VERIFIED',
44-
internal_ticket_number = UUID('acde070d-8c4c-4f0d-9d8a-162843c10333'),
43+
internal_ticket_number = 'acde070d-8c4c-4f0d-9d8a-162843c10333',
4544
decline_reason_description = 'Invalid Information - Can\'t Validate URL - Website is not accessible / not available',
4645
resubmit_allowed = True,
4746
created_date_time = '2021-06-08T06:45:13Z',
@@ -94,7 +93,7 @@ def testTfvStatus(self):
9493
assert isinstance(instance, TfvStatus)
9594
assert instance.phone_number == '+18005555555'
9695
assert instance.status == 'VERIFIED'
97-
assert instance.internal_ticket_number == UUID('acde070d-8c4c-4f0d-9d8a-162843c10333')
96+
assert instance.internal_ticket_number == 'acde070d-8c4c-4f0d-9d8a-162843c10333'
9897
assert instance.decline_reason_description == 'Invalid Information - Can\'t Validate URL - Website is not accessible / not available'
9998
assert instance.resubmit_allowed == True
10099
assert isinstance(instance.created_date_time, datetime)

test/unit/models/test_verification_denial_webhook.py

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

1515

1616
import unittest
17-
from uuid import UUID
1817

1918
from bandwidth.models.verification_denial_webhook import VerificationDenialWebhook
2019

@@ -38,7 +37,7 @@ def make_instance(self, include_optional) -> VerificationDenialWebhook:
3837
additional_denial_reasons = [{"statusCode":512,"reason":"Reason A","resubmitAllowed":True},{"statusCode":513,"reason":"Reason B","resubmitAllowed":True}],
3938
decline_reason_description = 'Invalid Information - Can\'t Validate URL - Website is not accessible / not available',
4039
denial_status_code = 511,
41-
internal_ticket_number = UUID('acde070d-8c4c-4f0d-9d8a-162843c10333'),
40+
internal_ticket_number = 'acde070d-8c4c-4f0d-9d8a-162843c10333',
4241
phone_number = '+18005555555',
4342
resubmit_allowed = True,
4443
status = 'UNVERIFIED',
@@ -65,7 +64,7 @@ def testVerificationDenialWebhook(self):
6564
assert instance.additional_denial_reasons[1].resubmit_allowed == True
6665
assert instance.decline_reason_description == 'Invalid Information - Can\'t Validate URL - Website is not accessible / not available'
6766
assert instance.denial_status_code == 511
68-
assert instance.internal_ticket_number == UUID('acde070d-8c4c-4f0d-9d8a-162843c10333')
67+
assert instance.internal_ticket_number == 'acde070d-8c4c-4f0d-9d8a-162843c10333'
6968
assert instance.phone_number == '+18005555555'
7069
assert instance.resubmit_allowed == True
7170
assert instance.status == 'UNVERIFIED'

test/unit/models/test_verification_webhook.py

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

1515

1616
import unittest
17-
from uuid import UUID
1817

1918
from bandwidth.models.verification_webhook import VerificationWebhook
2019

@@ -37,7 +36,7 @@ def make_instance(self, include_optional) -> VerificationWebhook:
3736
account_id = '1234567',
3837
phone_number = '+18005555555',
3938
status = 'VERIFIED',
40-
internal_ticket_number = UUID('acde070d-8c4c-4f0d-9d8a-162843c10333')
39+
internal_ticket_number = 'acde070d-8c4c-4f0d-9d8a-162843c10333'
4140
)
4241
else:
4342
return VerificationWebhook(
@@ -51,7 +50,7 @@ def testVerificationWebhook(self):
5150
assert instance.account_id == '1234567'
5251
assert instance.phone_number == '+18005555555'
5352
assert instance.status == 'VERIFIED'
54-
assert instance.internal_ticket_number == UUID('acde070d-8c4c-4f0d-9d8a-162843c10333')
53+
assert instance.internal_ticket_number == 'acde070d-8c4c-4f0d-9d8a-162843c10333'
5554

5655
if __name__ == '__main__':
5756
unittest.main()

0 commit comments

Comments
 (0)