forked from twilio/twilio-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Librarian] Regenerated @ a72b955e51d75514f3c944c81b9db17278cfad69
- Loading branch information
Showing
22 changed files
with
1,841 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
tests/integration/flex_api/v1/test_insights_questionnaires_category.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
137
tests/integration/flex_api/v1/test_insights_questionnaires_question.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.