Skip to content

Commit 7012fdb

Browse files
Add tests
1 parent c9343c4 commit 7012fdb

19 files changed

+1061
-3
lines changed

.github/workflows/python.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
# python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
17-
python-version: ["3.11"]
16+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1817

1918
steps:
2019
- uses: actions/checkout@v4

.openapi-generator/FILES

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.github/workflows/python.yml
22
.gitignore
33
.gitlab-ci.yml
4-
.openapi-generator-ignore
54
.travis.yml
65
README.md
76
agones_python_sdk/__init__.py
@@ -51,4 +50,21 @@ requirements.txt
5150
setup.cfg
5251
setup.py
5352
test-requirements.txt
53+
test/__init__.py
54+
test/test_game_server_object_meta.py
55+
test/test_game_server_spec.py
56+
test/test_game_server_spec_health.py
57+
test/test_googlerpc_status.py
58+
test/test_protobuf_any.py
59+
test/test_sdk_api.py
60+
test/test_sdk_duration.py
61+
test/test_sdk_game_server.py
62+
test/test_sdk_game_server_status.py
63+
test/test_sdk_key_value.py
64+
test/test_status_address.py
65+
test/test_status_counter_status.py
66+
test/test_status_list_status.py
67+
test/test_status_player_status.py
68+
test/test_status_port.py
69+
test/test_stream_result_of_sdk_game_server.py
5470
tox.ini

test/__init__.py

Whitespace-only changes.

test/test_game_server_object_meta.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# coding: utf-8
2+
3+
"""
4+
sdk.proto
5+
6+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7+
8+
The version of the OpenAPI document: version not set
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
15+
import unittest
16+
17+
from agones_python_sdk.models.game_server_object_meta import GameServerObjectMeta
18+
19+
class TestGameServerObjectMeta(unittest.TestCase):
20+
"""GameServerObjectMeta unit test stubs"""
21+
22+
def setUp(self):
23+
pass
24+
25+
def tearDown(self):
26+
pass
27+
28+
def make_instance(self, include_optional) -> GameServerObjectMeta:
29+
"""Test GameServerObjectMeta
30+
include_optional is a boolean, when False only required
31+
params are included, when True both required and
32+
optional params are included """
33+
# uncomment below to create an instance of `GameServerObjectMeta`
34+
"""
35+
model = GameServerObjectMeta()
36+
if include_optional:
37+
return GameServerObjectMeta(
38+
name = '',
39+
namespace = '',
40+
uid = '',
41+
resource_version = '',
42+
generation = '',
43+
creation_timestamp = '',
44+
deletion_timestamp = '',
45+
annotations = {
46+
'key' : ''
47+
},
48+
labels = {
49+
'key' : ''
50+
}
51+
)
52+
else:
53+
return GameServerObjectMeta(
54+
)
55+
"""
56+
57+
def testGameServerObjectMeta(self):
58+
"""Test GameServerObjectMeta"""
59+
# inst_req_only = self.make_instance(include_optional=False)
60+
# inst_req_and_optional = self.make_instance(include_optional=True)
61+
62+
if __name__ == '__main__':
63+
unittest.main()

test/test_game_server_spec.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# coding: utf-8
2+
3+
"""
4+
sdk.proto
5+
6+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7+
8+
The version of the OpenAPI document: version not set
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
15+
import unittest
16+
17+
from agones_python_sdk.models.game_server_spec import GameServerSpec
18+
19+
class TestGameServerSpec(unittest.TestCase):
20+
"""GameServerSpec unit test stubs"""
21+
22+
def setUp(self):
23+
pass
24+
25+
def tearDown(self):
26+
pass
27+
28+
def make_instance(self, include_optional) -> GameServerSpec:
29+
"""Test GameServerSpec
30+
include_optional is a boolean, when False only required
31+
params are included, when True both required and
32+
optional params are included """
33+
# uncomment below to create an instance of `GameServerSpec`
34+
"""
35+
model = GameServerSpec()
36+
if include_optional:
37+
return GameServerSpec(
38+
health = agones_python_sdk.models.game_server_spec_health.GameServerSpecHealth(
39+
disabled = True,
40+
period_seconds = 56,
41+
failure_threshold = 56,
42+
initial_delay_seconds = 56, )
43+
)
44+
else:
45+
return GameServerSpec(
46+
)
47+
"""
48+
49+
def testGameServerSpec(self):
50+
"""Test GameServerSpec"""
51+
# inst_req_only = self.make_instance(include_optional=False)
52+
# inst_req_and_optional = self.make_instance(include_optional=True)
53+
54+
if __name__ == '__main__':
55+
unittest.main()

test/test_game_server_spec_health.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# coding: utf-8
2+
3+
"""
4+
sdk.proto
5+
6+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7+
8+
The version of the OpenAPI document: version not set
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
15+
import unittest
16+
17+
from agones_python_sdk.models.game_server_spec_health import GameServerSpecHealth
18+
19+
class TestGameServerSpecHealth(unittest.TestCase):
20+
"""GameServerSpecHealth unit test stubs"""
21+
22+
def setUp(self):
23+
pass
24+
25+
def tearDown(self):
26+
pass
27+
28+
def make_instance(self, include_optional) -> GameServerSpecHealth:
29+
"""Test GameServerSpecHealth
30+
include_optional is a boolean, when False only required
31+
params are included, when True both required and
32+
optional params are included """
33+
# uncomment below to create an instance of `GameServerSpecHealth`
34+
"""
35+
model = GameServerSpecHealth()
36+
if include_optional:
37+
return GameServerSpecHealth(
38+
disabled = True,
39+
period_seconds = 56,
40+
failure_threshold = 56,
41+
initial_delay_seconds = 56
42+
)
43+
else:
44+
return GameServerSpecHealth(
45+
)
46+
"""
47+
48+
def testGameServerSpecHealth(self):
49+
"""Test GameServerSpecHealth"""
50+
# inst_req_only = self.make_instance(include_optional=False)
51+
# inst_req_and_optional = self.make_instance(include_optional=True)
52+
53+
if __name__ == '__main__':
54+
unittest.main()

test/test_googlerpc_status.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# coding: utf-8
2+
3+
"""
4+
sdk.proto
5+
6+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7+
8+
The version of the OpenAPI document: version not set
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
15+
import unittest
16+
17+
from agones_python_sdk.models.googlerpc_status import GooglerpcStatus
18+
19+
class TestGooglerpcStatus(unittest.TestCase):
20+
"""GooglerpcStatus unit test stubs"""
21+
22+
def setUp(self):
23+
pass
24+
25+
def tearDown(self):
26+
pass
27+
28+
def make_instance(self, include_optional) -> GooglerpcStatus:
29+
"""Test GooglerpcStatus
30+
include_optional is a boolean, when False only required
31+
params are included, when True both required and
32+
optional params are included """
33+
# uncomment below to create an instance of `GooglerpcStatus`
34+
"""
35+
model = GooglerpcStatus()
36+
if include_optional:
37+
return GooglerpcStatus(
38+
code = 56,
39+
message = '',
40+
details = [
41+
{
42+
'key' : None
43+
}
44+
]
45+
)
46+
else:
47+
return GooglerpcStatus(
48+
)
49+
"""
50+
51+
def testGooglerpcStatus(self):
52+
"""Test GooglerpcStatus"""
53+
# inst_req_only = self.make_instance(include_optional=False)
54+
# inst_req_and_optional = self.make_instance(include_optional=True)
55+
56+
if __name__ == '__main__':
57+
unittest.main()

test/test_protobuf_any.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# coding: utf-8
2+
3+
"""
4+
sdk.proto
5+
6+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7+
8+
The version of the OpenAPI document: version not set
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
15+
import unittest
16+
17+
from agones_python_sdk.models.protobuf_any import ProtobufAny
18+
19+
class TestProtobufAny(unittest.TestCase):
20+
"""ProtobufAny unit test stubs"""
21+
22+
def setUp(self):
23+
pass
24+
25+
def tearDown(self):
26+
pass
27+
28+
def make_instance(self, include_optional) -> ProtobufAny:
29+
"""Test ProtobufAny
30+
include_optional is a boolean, when False only required
31+
params are included, when True both required and
32+
optional params are included """
33+
# uncomment below to create an instance of `ProtobufAny`
34+
"""
35+
model = ProtobufAny()
36+
if include_optional:
37+
return ProtobufAny(
38+
type = ''
39+
)
40+
else:
41+
return ProtobufAny(
42+
)
43+
"""
44+
45+
def testProtobufAny(self):
46+
"""Test ProtobufAny"""
47+
# inst_req_only = self.make_instance(include_optional=False)
48+
# inst_req_and_optional = self.make_instance(include_optional=True)
49+
50+
if __name__ == '__main__':
51+
unittest.main()

0 commit comments

Comments
 (0)