|
| 1 | +# coding=utf-8 |
| 2 | +""" |
| 3 | +This code was generated by |
| 4 | +\ / _ _ _| _ _ |
| 5 | + | (_)\/(_)(_|\/| |(/_ v1.0.0 |
| 6 | + / / |
| 7 | +""" |
| 8 | + |
| 9 | +from tests import IntegrationTestCase |
| 10 | +from tests.holodeck import Request |
| 11 | +from twilio.base.exceptions import TwilioException |
| 12 | +from twilio.http.response import Response |
| 13 | + |
| 14 | + |
| 15 | +class CompositionSettingsTestCase(IntegrationTestCase): |
| 16 | + |
| 17 | + def test_fetch_request(self): |
| 18 | + self.holodeck.mock(Response(500, '')) |
| 19 | + |
| 20 | + with self.assertRaises(TwilioException): |
| 21 | + self.client.video.v1.composition_settings().fetch() |
| 22 | + |
| 23 | + self.holodeck.assert_has_request(Request( |
| 24 | + 'get', |
| 25 | + 'https://video.twilio.com/v1/CompositionSettings/Default', |
| 26 | + )) |
| 27 | + |
| 28 | + def test_fetch_response(self): |
| 29 | + self.holodeck.mock(Response( |
| 30 | + 200, |
| 31 | + ''' |
| 32 | + { |
| 33 | + "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", |
| 34 | + "friendly_name": "string", |
| 35 | + "aws_credentials_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", |
| 36 | + "encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", |
| 37 | + "aws_s3_url": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/", |
| 38 | + "aws_storage_enabled": true, |
| 39 | + "encryption_enabled": true, |
| 40 | + "url": "https://video.twilio.com/v1/CompositionSettings/Default" |
| 41 | + } |
| 42 | + ''' |
| 43 | + )) |
| 44 | + |
| 45 | + actual = self.client.video.v1.composition_settings().fetch() |
| 46 | + |
| 47 | + self.assertIsNotNone(actual) |
| 48 | + |
| 49 | + def test_create_request(self): |
| 50 | + self.holodeck.mock(Response(500, '')) |
| 51 | + |
| 52 | + with self.assertRaises(TwilioException): |
| 53 | + self.client.video.v1.composition_settings().create(friendly_name="friendly_name") |
| 54 | + |
| 55 | + values = {'FriendlyName': "friendly_name", } |
| 56 | + |
| 57 | + self.holodeck.assert_has_request(Request( |
| 58 | + 'post', |
| 59 | + 'https://video.twilio.com/v1/CompositionSettings/Default', |
| 60 | + data=values, |
| 61 | + )) |
| 62 | + |
| 63 | + def test_create_response(self): |
| 64 | + self.holodeck.mock(Response( |
| 65 | + 201, |
| 66 | + ''' |
| 67 | + { |
| 68 | + "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", |
| 69 | + "friendly_name": "friendly_name", |
| 70 | + "aws_credentials_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", |
| 71 | + "encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", |
| 72 | + "aws_s3_url": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/", |
| 73 | + "aws_storage_enabled": true, |
| 74 | + "encryption_enabled": true, |
| 75 | + "url": "https://video.twilio.com/v1/CompositionSettings/Default" |
| 76 | + } |
| 77 | + ''' |
| 78 | + )) |
| 79 | + |
| 80 | + actual = self.client.video.v1.composition_settings().create(friendly_name="friendly_name") |
| 81 | + |
| 82 | + self.assertIsNotNone(actual) |
0 commit comments