Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Merge branch '9.0.0-rc' into main #767

Merged
merged 17 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat!: MVR release preparation (#766)
* feat!: MVR release preparation

* fix: added test for json data in http client
  • Loading branch information
tiwarishubham635 authored Feb 21, 2024
commit 441d7329e261bf612a8631235d17b4f06ec95b9f
38 changes: 0 additions & 38 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,6 @@ twilio-python Changelog

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

[2024-02-09] Version 9.0.0-rc.2
-------------------------------
**Library - Chore**
- [PR #765](https://github.com/twilio/twilio-python/pull/765): disables cluster test. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!

**Flex**
- Adding `flex_instance_sid` to Flex Configuration

**Insights**
- add flag to restrict access to unapid customers

**Lookups**
- Remove `carrier` field from `sms_pumping_risk` and leave `carrier_risk_category` **(breaking change)**
- Remove carrier information from call forwarding package **(breaking change)**

**Messaging**
- Add update instance endpoints to us_app_to_person api

**Push**
- Migrated to new Push API V4 with Resilient Notification Delivery.

**Trusthub**
- Add optional field NotificationEmail to the POST /v1/ComplianceInquiries/Customers/Initialize API

**Verify**
- `Tags` property added again to Public Docs **(breaking change)**


[2024-01-08] Version 9.0.0-rc.1
-------------------------------
**Library - Chore**
- [PR #743](https://github.com/twilio/twilio-python/pull/743): sync with main. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!


[2023-12-06] Version 9.0.0-rc.0
---------------------------
- Release Candidate preparation

[2023-12-14] Version 8.11.0
---------------------------
**Library - Chore**
Expand Down
9 changes: 4 additions & 5 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
_`MAJOR` version bumps will have upgrade notes
posted here._

## [2023-12-06] 8.x.x to 9.x.x-rc.x

---
## [2024-02-20] 8.x.x to 9.x.x
### Overview

#### Twilio Python Helper Library’s major version 9.0.0-rc.x is now available. We ensured that you can upgrade to Python helper Library 9.0.0-rc.x version without any breaking changes
##### Twilio Python Helper Library’s major version 9.0.0 is now available. We ensured that you can upgrade to Python helper Library 9.0.0 version without any breaking changes of existing apis

Support for JSON payloads has been added in the request body
Behind the scenes Python Helper is now auto-generated via OpenAPI with this release. This enables us to rapidly add new features and enhance consistency across versions and languages.
We're pleased to inform you that version 9.0.0 adds support for the application/json content type in the request body.


## [2023-04-05] 7.x.x to 8.x.x
Expand Down
26 changes: 26 additions & 0 deletions tests/unit/http/test_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,32 @@ def test_last_request_last_response_exist(self):
"testing-unicode: Ω≈ç√, 💩", self.client._test_only_last_response.text
)

def test_request_with_json(self):
self.request_mock.url = "https://api.twilio.com/"
self.request_mock.headers = {"Host": "other.twilio.com"}

self.client.request(
"doesnt-matter-method",
"doesnt-matter-url",
{"params-value": "params-key"},
{"json-key": "json-value"},
{"Content-Type": "application/json"},
)

self.assertIsNotNone(self.client._test_only_last_request)
self.assertEqual(
{"Content-Type": "application/json"},
self.client._test_only_last_request.headers,
)

self.assertIsNotNone(self.client._test_only_last_response)

if self.client._test_only_last_response is not None:
self.assertEqual(200, self.client._test_only_last_response.status_code)
self.assertEqual(
"testing-unicode: Ω≈ç√, 💩", self.client._test_only_last_response.text
)

def test_last_response_empty_on_error(self):
self.session_mock.send.side_effect = Exception("voltron")

Expand Down
Loading