From 58859857b98588c51bcad3aae7c9ae732805ec6a Mon Sep 17 00:00:00 2001 From: manisha1997 Date: Thu, 16 Nov 2023 13:59:07 +0530 Subject: [PATCH] feat: geolocation setter in sendgrid-python for GDPR compliance --- test/unit/test_sendgrid.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/unit/test_sendgrid.py b/test/unit/test_sendgrid.py index d5185a09..1815d43a 100644 --- a/test/unit/test_sendgrid.py +++ b/test/unit/test_sendgrid.py @@ -4,33 +4,33 @@ class UnitTests(unittest.TestCase): def test_host_with_no_region(self): sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY') - self.assertEqual("https://api.sendgrid.com",sg.host) + self.assertEqual("https://api.sendgrid.com",sg.client.host) def test_host_with_eu_region(self): sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY') sg.set_data_residency("eu") - self.assertEqual("https://api.eu.sendgrid.com",sg.host) + self.assertEqual("https://api.eu.sendgrid.com",sg.client.host) def test_host_with_global_region(self): sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY') sg.set_data_residency("global") - self.assertEqual("https://api.sendgrid.com",sg.host) + self.assertEqual("https://api.sendgrid.com",sg.client.host) def test_host_with_host_first_eu_region_second(self): sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY') sg.set_host("https://sendgrid.com") sg.set_data_residency("eu") - self.assertEqual("https://api.eu.sendgrid.com",sg.host) + self.assertEqual("https://api.eu.sendgrid.com",sg.client.host) def test_host_with_eu_first_host_second(self): sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY') sg.set_data_residency("eu") sg.set_host("https://sendgrid.com") - self.assertEqual("https://sendgrid.com",sg.host) + self.assertEqual("https://sendgrid.com",sg.client.host) def test_host_using_constructor(self): sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY',host='https://sendgrid.com') - self.assertEqual("https://sendgrid.com",sg.host) + self.assertEqual("https://sendgrid.com",sg.client.host) def test_with_region_is_none(self): sg = sendgrid.SendGridAPIClient(api_key='MY_API_KEY')