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 30, 2023
2 parents 7f6fd67 + 3287369 commit 19ac732
Show file tree
Hide file tree
Showing 36 changed files with 441 additions and 50 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/test-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Run Go Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.19.6'
- name: Run Tests
run: |
npm install
npm run generate.go
cd ./clients/go/test
go test
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.14.0](https://github.com/phrase/openapi/compare/cli-v2.13.0...cli-v2.14.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

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


Expand Down
8 changes: 4 additions & 4 deletions 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.15.0 // x-release-please-version
github.com/phrase/phrase-go/v2 v2.16.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 All @@ -27,10 +27,10 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions clients/cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -410,17 +410,17 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
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.16.0](https://github.com/phrase/openapi/compare/go-v2.15.0...go-v2.16.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

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


Expand Down
124 changes: 124 additions & 0 deletions clients/go/test/api_locales_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 79 additions & 0 deletions clients/go/test/api_uploads_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.15.0](https://github.com/phrase/openapi/compare/java-v1.14.0...java-v1.15.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

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


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.15.0](https://github.com/phrase/openapi/compare/php-v1.14.0...php-v1.15.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

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


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

## [1.15.0](https://github.com/phrase/openapi/compare/python-v1.14.1...python-v1.15.0) (2023-10-23)


### Features

* **API:** Add order param to comment list endpoints ([#441](https://github.com/phrase/openapi/issues/441)) ([441c9c4](https://github.com/phrase/openapi/commit/441c9c46169f8c5ac4e71ade09a95dab136314ef))

## [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)


Expand Down
3 changes: 3 additions & 0 deletions clients/python/test/fixtures/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"key": "value"
}
23 changes: 21 additions & 2 deletions clients/python/test/test_locales_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,31 @@ def test_locale_delete(self):
"""
pass

def test_locale_download(self):
@patch('urllib3.PoolManager.urlopen')
def test_locale_download(self, mock_get):
"""Test case for locale_download
Download a locale # noqa: E501
"""
pass

body = bytes('{"key":"value"}', 'utf-8')
mock_get.return_value = Mock(ok=True)
mock_get.return_value.data = body
mock_get.return_value.status = 200
mock_get.return_value.getencoding.return_value = 'utf-8'
mock_get.return_value.getheader.side_effect = { 'Content-Disposition': None }.get

with phrase_api.ApiClient(self.configuration) as api_client:
api_instance = phrase_api.api.locales_api.LocalesApi(api_client)
api_response = api_instance.locale_download("project_id_example", "en", file_format="simple_json", format_options={"enable_pluralization": True, "custom_metadata_columns": { "E": "text" }})

self.assertEqual("https://api.phrase.com/v2/projects/project_id_example/locales/en/download?file_format=simple_json&format_options%5Benable_pluralization%5D=True&format_options%5Bcustom_metadata_columns%5D%5BE%5D=text", mock_get.call_args_list[0].args[1])

self.assertIsNotNone(api_response)
file = open(api_response, "r")
content = file.read()
file.close()
self.assertEqual(body.decode(), content)

def test_locale_show(self):
"""Test case for locale_show
Expand Down
Loading

0 comments on commit 19ac732

Please sign in to comment.