Skip to content

Commit

Permalink
Merge branch 'master' into tsi-1874-update-generator-v7
Browse files Browse the repository at this point in the history
  • Loading branch information
jablan committed Oct 13, 2023
2 parents b48ecbf + 7442f08 commit 726d7e2
Show file tree
Hide file tree
Showing 41 changed files with 1,224 additions and 59 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run Python Tests
on: [push]
jobs:
unittest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
npm install
npm run generate.python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
working-directory: ./clients/python
- name: Run tests
run: |
cd ./clients/python
pip install -r requirements.txt -r test-requirements.txt
python -m unittest
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
clients/go/
clients/python/

clients/python/*
!clients/python/test/test_locales_api.py
!clients/python/test/test_uploads_api.py

clients/ruby/.*
clients/ruby/Gemfile*
Expand Down
7 changes: 7 additions & 0 deletions clients/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.13.0](https://github.com/phrase/openapi/compare/cli-v2.12.0...cli-v2.13.0) (2023-10-13)


### Features

* **API:** Implement figma attachments endpoints ([#415](https://github.com/phrase/openapi/issues/415)) ([970e612](https://github.com/phrase/openapi/commit/970e612fda620ca882a221ef541036b8d200b675))

## [2.12.0](https://github.com/phrase/openapi/compare/cli-v2.11.0...cli-v2.12.0) (2023-09-14)


Expand Down
2 changes: 1 addition & 1 deletion clients/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/daviddengcn/go-colortext v1.0.0
github.com/jpillora/backoff v1.0.0
github.com/mitchellh/mapstructure v1.4.0
github.com/phrase/phrase-go/v2 v2.14.0 // x-release-please-version
github.com/phrase/phrase-go/v2 v2.15.0 // x-release-please-version
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.7.1
gopkg.in/yaml.v2 v2.4.0
Expand Down
6 changes: 2 additions & 4 deletions clients/cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,8 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM=
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
github.com/phrase/phrase-go/v2 v2.13.0 h1:FypJdgcrD1z/cV0wHqZEObovwH6k0neG2L3BT3ixGi8=
github.com/phrase/phrase-go/v2 v2.13.0/go.mod h1:N1ou4nnB9ak8aAWOH7x25Xhzw8FmFeBRhSGq5A0CY2o=
github.com/phrase/phrase-go/v2 v2.14.0 h1:l81OsZIgxx69YyUgOA+RIbYMk+ukiQ/vbJMYLqe+z+A=
github.com/phrase/phrase-go/v2 v2.14.0/go.mod h1:N1ou4nnB9ak8aAWOH7x25Xhzw8FmFeBRhSGq5A0CY2o=
github.com/phrase/phrase-go/v2 v2.15.0 h1:9v9B6p8z7yw5OYpAIOajHcD+tQMJyrBT79Dimxdk10A=
github.com/phrase/phrase-go/v2 v2.15.0/go.mod h1:N1ou4nnB9ak8aAWOH7x25Xhzw8FmFeBRhSGq5A0CY2o=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
Expand Down
7 changes: 7 additions & 0 deletions clients/go/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.15.0](https://github.com/phrase/openapi/compare/go-v2.14.0...go-v2.15.0) (2023-10-13)


### Features

* **API:** Implement figma attachments endpoints ([#415](https://github.com/phrase/openapi/issues/415)) ([970e612](https://github.com/phrase/openapi/commit/970e612fda620ca882a221ef541036b8d200b675))

## [2.14.0](https://github.com/phrase/openapi/compare/go-v2.13.0...go-v2.14.0) (2023-09-12)


Expand Down
7 changes: 7 additions & 0 deletions clients/java/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.14.0](https://github.com/phrase/openapi/compare/java-v1.13.0...java-v1.14.0) (2023-10-13)


### Features

* **API:** Implement figma attachments endpoints ([#415](https://github.com/phrase/openapi/issues/415)) ([970e612](https://github.com/phrase/openapi/commit/970e612fda620ca882a221ef541036b8d200b675))

## [1.13.0](https://github.com/phrase/openapi/compare/java-v1.12.0...java-v1.13.0) (2023-09-12)


Expand Down
7 changes: 7 additions & 0 deletions clients/php/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.14.0](https://github.com/phrase/openapi/compare/php-v1.13.0...php-v1.14.0) (2023-10-13)


### Features

* **API:** Implement figma attachments endpoints ([#415](https://github.com/phrase/openapi/issues/415)) ([970e612](https://github.com/phrase/openapi/commit/970e612fda620ca882a221ef541036b8d200b675))

## [1.13.0](https://github.com/phrase/openapi/compare/php-v1.12.0...php-v1.13.0) (2023-09-12)


Expand Down
7 changes: 7 additions & 0 deletions clients/python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.14.0](https://github.com/phrase/openapi/compare/python-v1.13.0...python-v1.14.0) (2023-10-13)


### Features

* **API:** Implement figma attachments endpoints ([#415](https://github.com/phrase/openapi/issues/415)) ([970e612](https://github.com/phrase/openapi/commit/970e612fda620ca882a221ef541036b8d200b675))

## [1.13.0](https://github.com/phrase/openapi/compare/python-v1.12.0...python-v1.13.0) (2023-09-12)


Expand Down
102 changes: 102 additions & 0 deletions clients/python/test/test_locales_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# coding: utf-8

"""
Phrase Strings API Reference
The version of the OpenAPI document: 2.0.0
Contact: support@phrase.com
Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import unittest
from unittest.mock import Mock, patch


import phrase_api
from phrase_api.api.locales_api import LocalesApi # noqa: E501
from phrase_api.rest import ApiException


class TestLocalesApi(unittest.TestCase):
"""LocalesApi unit test stubs"""

def setUp(self):
self.configuration = phrase_api.Configuration()
self.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
self.configuration.api_key_prefix['Authorization'] = 'token'

def tearDown(self):
pass

def test_account_locales(self):
"""Test case for account_locales
List locales used in account # noqa: E501
"""
pass



def test_locale_create(self):
"""Test case for locale_create
Create a locale # noqa: E501
"""
pass

def test_locale_delete(self):
"""Test case for locale_delete
Delete a locale # noqa: E501
"""
pass

def test_locale_download(self):
"""Test case for locale_download
Download a locale # noqa: E501
"""
pass

def test_locale_show(self):
"""Test case for locale_show
Get a single locale # noqa: E501
"""
pass

def test_locale_update(self):
"""Test case for locale_update
Update a locale # noqa: E501
"""
pass

@patch('phrase_api.ApiClient.request')
def test_locales_list(self, mock_get):
"""Test case for locales_list
List locales # noqa: E501
"""
mock_get.return_value = Mock(ok=True)
mock_get.return_value.data = '[{"id":"locale_id","name":"locale_name","code":"locale_code","default":true,"main":true,"rtl":true,"plural_forms":["plural_forms"]}]'

project_id = "project_id_example"
with phrase_api.ApiClient(self.configuration) as api_client:
api_instance = phrase_api.api.locales_api.LocalesApi(api_client)
api_response = api_instance.locales_list(project_id)

self.assertIsNotNone(api_response)
self.assertEqual(1, len(api_response))
self.assertIsInstance(api_response[0], phrase_api.models.locale.Locale)
self.assertEqual("locale_id", api_response[0].id)
self.assertEqual("locale_id", api_response[0].id)
self.assertEqual("locale_name", api_response[0].name)



if __name__ == '__main__':
unittest.main()
71 changes: 71 additions & 0 deletions clients/python/test/test_uploads_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# coding: utf-8

"""
Phrase Strings API Reference
The version of the OpenAPI document: 2.0.0
Contact: support@phrase.com
Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import unittest
from unittest.mock import Mock, patch

import phrase_api
from phrase_api.api.uploads_api import UploadsApi # noqa: E501
from phrase_api.rest import ApiException


class TestUploadsApi(unittest.TestCase):
"""UploadsApi unit test stubs"""

def setUp(self):
self.configuration = phrase_api.Configuration()
self.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
self.configuration.api_key_prefix['Authorization'] = 'token'

def tearDown(self):
pass

@patch('phrase_api.ApiClient.request')
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"}'

project_id = "project_id_example"
with phrase_api.ApiClient(self.configuration) as api_client:
api_instance = phrase_api.UploadsApi(api_client)
api_response = api_instance.upload_create(project_id, file="./README.md", file_format="simple_json")

self.assertEqual("POST", mock_post.call_args_list[0].args[0])
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)
self.assertEqual("upload_id", api_response.id)
self.assertEqual("simple_json", api_response.format)

def test_upload_show(self):
"""Test case for upload_show
Get a single upload # noqa: E501
"""
pass

def test_uploads_list(self):
"""Test case for uploads_list
List uploads # noqa: E501
"""
pass


if __name__ == '__main__':
unittest.main()
7 changes: 7 additions & 0 deletions clients/ruby/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.17.0](https://github.com/phrase/openapi/compare/ruby-v2.16.0...ruby-v2.17.0) (2023-10-13)


### Features

* **API:** Implement figma attachments endpoints ([#415](https://github.com/phrase/openapi/issues/415)) ([970e612](https://github.com/phrase/openapi/commit/970e612fda620ca882a221ef541036b8d200b675))

## [2.16.0](https://github.com/phrase/openapi/compare/ruby-v2.15.0...ruby-v2.16.0) (2023-09-12)


Expand Down
7 changes: 7 additions & 0 deletions clients/typescript/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.14.0](https://github.com/phrase/openapi/compare/typescript-v1.13.0...typescript-v1.14.0) (2023-10-13)


### Features

* **API:** Implement figma attachments endpoints ([#415](https://github.com/phrase/openapi/issues/415)) ([970e612](https://github.com/phrase/openapi/commit/970e612fda620ca882a221ef541036b8d200b675))

## [1.13.0](https://github.com/phrase/openapi/compare/typescript-v1.12.0...typescript-v1.13.0) (2023-09-12)


Expand Down
Loading

0 comments on commit 726d7e2

Please sign in to comment.