Skip to content

Commit 79b1c3a

Browse files
PhrasetheSoenke
Phrase
andauthored
chore(master): release python 1.14.1 (#438)
* chore(master): release python 1.14.1 * test: fix python upload test --------- Co-authored-by: Sönke Behrendt <[email protected]>
1 parent 12b06d6 commit 79b1c3a

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

clients/python/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [1.14.1](https://github.com/phrase/openapi/compare/python-v1.14.0...python-v1.14.1) (2023-10-23)
4+
5+
6+
### Bug Fixes
7+
8+
* **python:** pass format_options correctly ([#436](https://github.com/phrase/openapi/issues/436)) ([3621400](https://github.com/phrase/openapi/commit/362140060ab90463185b3b1f729b79c08226bf55))
9+
310
## [1.14.0](https://github.com/phrase/openapi/compare/python-v1.13.0...python-v1.14.0) (2023-10-13)
411

512

clients/python/test/test_uploads_api.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,28 @@ def setUp(self):
3030
def tearDown(self):
3131
pass
3232

33-
@patch('phrase_api.ApiClient.request')
33+
@patch('urllib3.PoolManager.urlopen')
3434
def test_upload_create(self, mock_post):
3535
"""Test case for upload_create
3636
3737
Upload a new file # noqa: E501
3838
"""
3939
mock_post.return_value = Mock(ok=True)
40-
mock_post.return_value.data = '{"id": "upload_id", "format": "simple_json"}'
40+
mock_post.return_value.data = '{"id": "upload_id", "format": "simple_json"}'.encode()
41+
mock_post.return_value.getencoding.return_value = 'utf-8'
42+
mock_post.return_value.status = 201
43+
mock_post.return_value.getheader.side_effect = { 'Content-Type': "application/json" }.get
4144

4245
project_id = "project_id_example"
4346
with phrase_api.ApiClient(self.configuration) as api_client:
4447
api_instance = phrase_api.UploadsApi(api_client)
4548
api_response = api_instance.upload_create(
4649
project_id,
4750
file="./test/fixtures/en.json",
48-
file_format="simple_json",
49-
format_options={"enable_pluralization": True}
51+
file_format="simple_json"
5052
)
5153

52-
mock_post.assert_called_with("POST", "https://api.phrase.com/v2/projects/project_id_example/uploads", query_params=[], headers={'Accept': 'application/json', 'Content-Type': 'multipart/form-data', 'User-Agent': 'OpenAPI-Generator/1.14.0/python', 'Authorization': 'token YOUR_API_KEY'}, post_params=[('file_format', 'simple_json'), ('format_options', {'enable_pluralization': True}), ('file', ('en.json', b'{\n "key": "value"\n}\n', 'application/json'))], body=None, _preload_content=True, _request_timeout=None)
54+
self.assertEqual("https://api.phrase.com/v2/projects/project_id_example/uploads", mock_post.call_args_list[0].args[1])
5355

5456
self.assertIsNotNone(api_response)
5557
self.assertIsInstance(api_response, phrase_api.models.upload.Upload)

openapi-generator/python_lang.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ generatorName: python
33
outputDir: clients/python
44
packageName: phrase_api
55
projectName: phrase-api
6-
packageVersion: 1.14.0
6+
packageVersion: 1.14.1
77
packageUrl: https://github.com/phrase/phrase-python
88
gitUserId: phrase
99
gitRepoId: phrase-python

release-please/manifest-python.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.14.0"
2+
".": "1.14.1"
33
}

0 commit comments

Comments
 (0)