Skip to content

Commit

Permalink
[Librarian] Regenerated @ a72b955e51d75514f3c944c81b9db17278cfad69
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-dx committed Jan 25, 2023
1 parent fdaae97 commit 6a0ab7f
Show file tree
Hide file tree
Showing 22 changed files with 1,841 additions and 151 deletions.
25 changes: 25 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@ twilio-python Changelog

Here you can see the full list of changes between each twilio-python release.

[2023-01-25] Version 7.16.2
---------------------------
**Library - Chore**
- [PR #638](https://github.com/twilio/twilio-python/pull/638): relax test dependencies and remove unused dependencies. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
- [PR #609](https://github.com/twilio/twilio-python/pull/609): Security upgrade pygments from 2.5.2 to 2.7.4. Thanks to [@twilio-product-security](https://github.com/twilio-product-security)!

**Library - Docs**
- [PR #637](https://github.com/twilio/twilio-python/pull/637): remove docs output from repo. Thanks to [@childish-sambino](https://github.com/childish-sambino)!

**Library - Test**
- [PR #636](https://github.com/twilio/twilio-python/pull/636): update tox config and replace deprecated test functions. Thanks to [@childish-sambino](https://github.com/childish-sambino)!

**Api**
- Add `public_application_connect_enabled` param to Application resource

**Messaging**
- Add new tollfree verification API property (ExternalReferenceId)]

**Verify**
- Add `device_ip` parameter and channel `auto` for sna/sms orchestration

**Twiml**
- Add support for `<Application>` noun and `<ApplicationSid>` noun, nested `<Parameter>` to `<Hangup>` and `<Leave>` verb


[2023-01-11] Version 7.16.1
---------------------------
**Conversations**
Expand Down
112 changes: 112 additions & 0 deletions tests/integration/flex_api/v1/test_insights_questionnaires_category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""

from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response


class InsightsQuestionnairesCategoryTestCase(IntegrationTestCase):

def test_create_request(self):
self.holodeck.mock(Response(500, ''))

with self.assertRaises(TwilioException):
self.client.flex_api.v1.insights_questionnaires_category.create(name="name", token="token")

values = {'Name': "name", }

headers = {'Token': "token", }
self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v1/Insights/QM/Categories',
headers=headers,
))
self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v1/Insights/QM/Categories',
data=values,
))

def test_create_response(self):
self.holodeck.mock(Response(
201,
'''
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"category_id": "4b4e78e4-4f05-49e2-bf52-0973c5cde419",
"name": "abc",
"url": "https://flex-api.twilio.com/v1/Insights/QM/Categories/4b4e78e4-4f05-49e2-bf52-0973c5cde419"
}
'''
))

actual = self.client.flex_api.v1.insights_questionnaires_category.create(name="name")

self.assertIsNotNone(actual)

def test_update_request(self):
self.holodeck.mock(Response(500, ''))

with self.assertRaises(TwilioException):
self.client.flex_api.v1.insights_questionnaires_category("category_id").update(name="name", token="token")

values = {'Name': "name", }

headers = {'Token': "token", }
self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v1/Insights/QM/Categories/category_id',
headers=headers,
))
self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v1/Insights/QM/Categories/category_id',
data=values,
))

def test_update_response(self):
self.holodeck.mock(Response(
200,
'''
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"category_id": "4b4e78e4-4f05-49e2-bf52-0973c5cde419",
"name": "abcd",
"url": "https://flex-api.twilio.com/v1/Insights/QM/Categories/4b4e78e4-4f05-49e2-bf52-0973c5cde419"
}
'''
))

actual = self.client.flex_api.v1.insights_questionnaires_category("category_id").update(name="name")

self.assertIsNotNone(actual)

def test_delete_request(self):
self.holodeck.mock(Response(500, ''))

with self.assertRaises(TwilioException):
self.client.flex_api.v1.insights_questionnaires_category("category_id").delete(token="token")

headers = {'Token': "token", }
self.holodeck.assert_has_request(Request(
'delete',
'https://flex-api.twilio.com/v1/Insights/QM/Categories/category_id',
headers=headers,
))

def test_delete_response(self):
self.holodeck.mock(Response(
204,
None,
))

actual = self.client.flex_api.v1.insights_questionnaires_category("category_id").delete()

self.assertTrue(actual)
137 changes: 137 additions & 0 deletions tests/integration/flex_api/v1/test_insights_questionnaires_question.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""

from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response


class InsightsQuestionnairesQuestionTestCase(IntegrationTestCase):

def test_create_request(self):
self.holodeck.mock(Response(500, ''))

with self.assertRaises(TwilioException):
self.client.flex_api.v1.insights_questionnaires_question.create(category_id="category_id", question="question", description="description", answer_set_id="answer_set_id", allow_na=True, token="token")

values = {
'CategoryId': "category_id",
'Question': "question",
'Description': "description",
'AnswerSetId': "answer_set_id",
'AllowNa': True,
}

headers = {'Token': "token", }
self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v1/Insights/QM/Questions',
headers=headers,
))
self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v1/Insights/QM/Questions',
data=values,
))

def test_create_response(self):
self.holodeck.mock(Response(
201,
'''
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"question": "What is the total time",
"question_id": "945ac7ff-8afc-4606-be76-e94b1a80cd72",
"description": "time spent",
"category": {
"category_name": "test cat",
"category_id": "4b4e78e4-4f05-49e2-bf52-0973c5cde418"
},
"answer_set_id": "a6a8a54f-5305-4aec-b92c-a6e429932f58",
"allow_na": false,
"url": "https://flex-api.twilio.com/v1/Insights/QM/Questions/945ac7ff-8afc-4606-be76-e94b1a80cd72"
}
'''
))

actual = self.client.flex_api.v1.insights_questionnaires_question.create(category_id="category_id", question="question", description="description", answer_set_id="answer_set_id", allow_na=True)

self.assertIsNotNone(actual)

def test_update_request(self):
self.holodeck.mock(Response(500, ''))

with self.assertRaises(TwilioException):
self.client.flex_api.v1.insights_questionnaires_question("question_id").update(question="question", description="description", answer_set_id="answer_set_id", allow_na=True, token="token")

values = {
'Question': "question",
'Description': "description",
'AnswerSetId': "answer_set_id",
'AllowNa': True,
}

headers = {'Token': "token", }
self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v1/Insights/QM/Questions/question_id',
headers=headers,
))
self.holodeck.assert_has_request(Request(
'post',
'https://flex-api.twilio.com/v1/Insights/QM/Questions/question_id',
data=values,
))

def test_update_response(self):
self.holodeck.mock(Response(
200,
'''
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"question": "What is the total time",
"question_id": "945ac7ff-8afc-4606-be76-e94b1a80cd72",
"description": "time spent",
"category": {
"category_name": "test cat",
"category_id": "4b4e78e4-4f05-49e2-bf52-0973c5cde418"
},
"answer_set_id": "a6a8a54f-5305-4aec-b92c-a6e429932f58",
"allow_na": false,
"url": "https://flex-api.twilio.com/v1/Insights/QM/Questions/945ac7ff-8afc-4606-be76-e94b1a80cd72"
}
'''
))

actual = self.client.flex_api.v1.insights_questionnaires_question("question_id").update(question="question", description="description", answer_set_id="answer_set_id", allow_na=True)

self.assertIsNotNone(actual)

def test_delete_request(self):
self.holodeck.mock(Response(500, ''))

with self.assertRaises(TwilioException):
self.client.flex_api.v1.insights_questionnaires_question("question_id").delete(token="token")

headers = {'Token': "token", }
self.holodeck.assert_has_request(Request(
'delete',
'https://flex-api.twilio.com/v1/Insights/QM/Questions/question_id',
headers=headers,
))

def test_delete_response(self):
self.holodeck.mock(Response(
204,
None,
))

actual = self.client.flex_api.v1.insights_questionnaires_question("question_id").delete()

self.assertTrue(actual)
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
from twilio.http.response import Response


class GoodDataTestCase(IntegrationTestCase):
class InsightsSessionTestCase(IntegrationTestCase):

def test_create_request(self):
self.holodeck.mock(Response(500, ''))

with self.assertRaises(TwilioException):
self.client.flex_api.v1.good_data().create(token="token")
self.client.flex_api.v1.insights_session().create(token="token")

headers = {'Token': "token", }
self.holodeck.assert_has_request(Request(
Expand All @@ -41,6 +41,6 @@ def test_create_response(self):
'''
))

actual = self.client.flex_api.v1.good_data().create()
actual = self.client.flex_api.v1.insights_session().create()

self.assertIsNotNone(actual)
Loading

0 comments on commit 6a0ab7f

Please sign in to comment.