From f258caf4dbe4bab808c32df283f041c8ed5e81ca Mon Sep 17 00:00:00 2001 From: sbansla Date: Thu, 27 Feb 2025 12:51:36 +0530 Subject: [PATCH 1/3] fix AssistantsBase import --- twilio/rest/assistants/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twilio/rest/assistants/__init__.py b/twilio/rest/assistants/__init__.py index 60c812014d..889daf9d29 100644 --- a/twilio/rest/assistants/__init__.py +++ b/twilio/rest/assistants/__init__.py @@ -1,6 +1,6 @@ from warnings import warn -from twilio.rest.assistants import AssistantsBase +from twilio.rest.assistants.AssistantsBase import AssistantsBase from twilio.rest.assistants.v1.assistant import AssistantList from twilio.rest.assistants.v1.knowledge import KnowledgeList from twilio.rest.assistants.v1.policy import PolicyList From a7b0abe4c8686cf9d68dd0cab08bae63976b0d8e Mon Sep 17 00:00:00 2001 From: sbansla Date: Thu, 27 Feb 2025 13:12:32 +0530 Subject: [PATCH 2/3] added cluster test to fetch assistant --- tests/cluster/test_cluster.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/cluster/test_cluster.py b/tests/cluster/test_cluster.py index 556fa8da75..0c18428d15 100644 --- a/tests/cluster/test_cluster.py +++ b/tests/cluster/test_cluster.py @@ -12,6 +12,7 @@ def setUp(self): self.api_key = os.environ["TWILIO_API_KEY"] self.api_secret = os.environ["TWILIO_API_SECRET"] self.account_sid = os.environ["TWILIO_ACCOUNT_SID"] + self.assistant_id = os.environ["ASSISTANT_ID"] self.client = Client( username=self.api_key, password=self.api_secret, @@ -65,6 +66,11 @@ def test_list_available_numbers(self): self.assertIsNotNone(toll_free_numbers) self.assertEqual(len(toll_free_numbers), 2) + def test_fetch_assistant(self): + assistant = self.client.assistants.v1.assistants(self.assistant_id).fetch() + self.assertIsNotNone(assistant) + self.assertEqual(assistant.account_sid, self.account_sid) + def test_calling_twiml_string(self): call = self.client.calls.create( to=self.to_number, from_=self.from_number, twiml=str(self.voice_twiml) From 9ee5f1176f79bf8e14bb5d0c9e3bf96ee0fd436d Mon Sep 17 00:00:00 2001 From: sbansla Date: Thu, 27 Feb 2025 13:18:24 +0530 Subject: [PATCH 3/3] fetching secret --- .github/workflows/test-and-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 1e1c04d500..db745daca2 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -47,6 +47,7 @@ jobs: TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} + ASSISTANT_ID: ${{ secrets.ASSISTANT_ID }} run: make cluster-test - name: Verify docs generation