From 79b1c3a6fb1fe56d92a2c3bfa9daafee3e58aa32 Mon Sep 17 00:00:00 2001 From: Phrase Date: Mon, 23 Oct 2023 15:27:39 +0200 Subject: [PATCH] chore(master): release python 1.14.1 (#438) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(master): release python 1.14.1 * test: fix python upload test --------- Co-authored-by: Sönke Behrendt --- clients/python/CHANGELOG.md | 7 +++++++ clients/python/test/test_uploads_api.py | 12 +++++++----- openapi-generator/python_lang.yaml | 2 +- release-please/manifest-python.json | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/clients/python/CHANGELOG.md b/clients/python/CHANGELOG.md index a119fc73..7c7366d3 100644 --- a/clients/python/CHANGELOG.md +++ b/clients/python/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.14.1](https://github.com/phrase/openapi/compare/python-v1.14.0...python-v1.14.1) (2023-10-23) + + +### Bug Fixes + +* **python:** pass format_options correctly ([#436](https://github.com/phrase/openapi/issues/436)) ([3621400](https://github.com/phrase/openapi/commit/362140060ab90463185b3b1f729b79c08226bf55)) + ## [1.14.0](https://github.com/phrase/openapi/compare/python-v1.13.0...python-v1.14.0) (2023-10-13) diff --git a/clients/python/test/test_uploads_api.py b/clients/python/test/test_uploads_api.py index d26f4280..d0081681 100644 --- a/clients/python/test/test_uploads_api.py +++ b/clients/python/test/test_uploads_api.py @@ -30,14 +30,17 @@ def setUp(self): def tearDown(self): pass - @patch('phrase_api.ApiClient.request') + @patch('urllib3.PoolManager.urlopen') def test_upload_create(self, mock_post): """Test case for upload_create Upload a new file # noqa: E501 """ mock_post.return_value = Mock(ok=True) - mock_post.return_value.data = '{"id": "upload_id", "format": "simple_json"}' + mock_post.return_value.data = '{"id": "upload_id", "format": "simple_json"}'.encode() + mock_post.return_value.getencoding.return_value = 'utf-8' + mock_post.return_value.status = 201 + mock_post.return_value.getheader.side_effect = { 'Content-Type': "application/json" }.get project_id = "project_id_example" with phrase_api.ApiClient(self.configuration) as api_client: @@ -45,11 +48,10 @@ def test_upload_create(self, mock_post): api_response = api_instance.upload_create( project_id, file="./test/fixtures/en.json", - file_format="simple_json", - format_options={"enable_pluralization": True} + file_format="simple_json" ) - 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) + self.assertEqual("https://api.phrase.com/v2/projects/project_id_example/uploads", mock_post.call_args_list[0].args[1]) self.assertIsNotNone(api_response) self.assertIsInstance(api_response, phrase_api.models.upload.Upload) diff --git a/openapi-generator/python_lang.yaml b/openapi-generator/python_lang.yaml index 69d6fd2d..80bf9fac 100644 --- a/openapi-generator/python_lang.yaml +++ b/openapi-generator/python_lang.yaml @@ -3,7 +3,7 @@ generatorName: python outputDir: clients/python packageName: phrase_api projectName: phrase-api -packageVersion: 1.14.0 +packageVersion: 1.14.1 packageUrl: https://github.com/phrase/phrase-python gitUserId: phrase gitRepoId: phrase-python diff --git a/release-please/manifest-python.json b/release-please/manifest-python.json index e72f1131..a780111d 100644 --- a/release-please/manifest-python.json +++ b/release-please/manifest-python.json @@ -1,3 +1,3 @@ { - ".": "1.14.0" + ".": "1.14.1" } \ No newline at end of file