Skip to content

Commit afebe73

Browse files
committed
fix: Regional API domain processing
1 parent 10ec296 commit afebe73

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/unit/rest/test_client.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,25 @@ def test_periods_in_query(self):
7878
"https://api.edge.region.twilio.com/path/to/something.json?foo=12.34",
7979
)
8080

81-
def test_edge_deprecation_warning(self):
81+
def test_edge_deprecation_warning_when_only_edge_is_set(self):
8282
with warnings.catch_warnings(record=True) as w:
8383
warnings.simplefilter("always") # Ensure all warnings are caught
8484
Client(username="username", password="password", edge="edge") # Trigger the warning
8585

8686
# Check if a warning was raised
8787
self.assertGreater(len(w), 0)
8888
self.assertTrue(issubclass(w[-1].category, DeprecationWarning))
89-
self.assertIn("`edge` is deprecated and will be removed in a future version. Use `region` instead.", str(w[-1].message))
89+
self.assertIn("For regional processing, DNS is of format product.<edge>.<region>.twilio.com; otherwise use product.twilio.com.", str(w[-1].message))
90+
91+
def test_edge_deprecation_warning_when_only_region_is_set(self):
92+
with warnings.catch_warnings(record=True) as w:
93+
warnings.simplefilter("always") # Ensure all warnings are caught
94+
Client(username="username", password="password", region="us1") # Trigger the warning
95+
96+
# Check if a warning was raised
97+
self.assertGreater(len(w), 0)
98+
self.assertTrue(issubclass(w[-1].category, DeprecationWarning))
99+
self.assertIn("For regional processing, DNS is of format product.<edge>.<region>.twilio.com; otherwise use product.twilio.com.", str(w[-1].message))
90100

91101

92102

0 commit comments

Comments
 (0)