Skip to content

Commit 0b2ba04

Browse files
authored
auto codegen for UMem
1 parent 0f7ca54 commit 0b2ba04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3899
-4045
lines changed

tests/test_acceptance/test_scenario_5183.py

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,15 @@ def test_scenario_5183(ustack_client, variables):
1717

1818
scenario.store["Region"] = "cn"
1919
scenario.store["Zone"] = "zone-01"
20-
scenario.store["BeginTime"] = funcs.get_timestamp(10,) - 3600
21-
scenario.store["EndTime"] = funcs.get_timestamp(10,)
20+
scenario.store["BeginTime"] = (
21+
funcs.get_timestamp(
22+
10,
23+
)
24+
- 3600
25+
)
26+
scenario.store["EndTime"] = funcs.get_timestamp(
27+
10,
28+
)
2229

2330
# 查询VPC信息
2431
describe_vpc_00(ustack_client)
@@ -351,7 +358,9 @@ def describe_vm_instance_07(step, client):
351358

352359
d = {
353360
"Zone": variables.get("Zone"),
354-
"VMIDs": [variables.get("VMID"),],
361+
"VMIDs": [
362+
variables.get("VMID"),
363+
],
355364
"Region": variables.get("Region"),
356365
}
357366

@@ -458,7 +467,9 @@ def describe_lb_10(step, client):
458467
d = {
459468
"Zone": variables.get("Zone"),
460469
"Region": variables.get("Region"),
461-
"LBIDs": [variables.get("LBID"),],
470+
"LBIDs": [
471+
variables.get("LBID"),
472+
],
462473
}
463474

464475
try:
@@ -682,7 +693,9 @@ def describe_rs_17(step, client):
682693
"Zone": variables.get("Zone"),
683694
"VSID": variables.get("VSID"),
684695
"Region": variables.get("Region"),
685-
"RSIDs": [variables.get("RSID"),],
696+
"RSIDs": [
697+
variables.get("RSID"),
698+
],
686699
"LBID": variables.get("LBID"),
687700
}
688701

@@ -745,7 +758,9 @@ def describe_rs_19(step, client):
745758
"Zone": variables.get("Zone"),
746759
"VSID": variables.get("VSID"),
747760
"Region": variables.get("Region"),
748-
"RSIDs": [variables.get("RSID"),],
761+
"RSIDs": [
762+
variables.get("RSID"),
763+
],
749764
"LBID": variables.get("LBID"),
750765
}
751766

@@ -776,7 +791,9 @@ def create_vs_policy_20(step, client):
776791
"Zone": variables.get("Zone"),
777792
"VSID": variables.get("VSID"),
778793
"Region": variables.get("Region"),
779-
"RSIDs": [variables.get("RSID"),],
794+
"RSIDs": [
795+
variables.get("RSID"),
796+
],
780797
"Path": "/test12321",
781798
"LBID": variables.get("LBID"),
782799
"Domain": "test.com11",
@@ -810,7 +827,9 @@ def describe_vs_policy_21(step, client):
810827
"Zone": variables.get("Zone"),
811828
"VSID": variables.get("VSID"),
812829
"Region": variables.get("Region"),
813-
"PolicyIDs": [variables.get("PolicyID"),],
830+
"PolicyIDs": [
831+
variables.get("PolicyID"),
832+
],
814833
"LBID": variables.get("LBID"),
815834
}
816835

tests/test_acceptance/test_scenario_5292.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,15 @@ def test_scenario_5292(ustack_client, variables):
1717

1818
scenario.store["Region"] = "cn"
1919
scenario.store["Zone"] = "zone-01"
20-
scenario.store["BeginTime"] = funcs.get_timestamp(10,) - 3600
21-
scenario.store["EndTime"] = funcs.get_timestamp(10,)
20+
scenario.store["BeginTime"] = (
21+
funcs.get_timestamp(
22+
10,
23+
)
24+
- 3600
25+
)
26+
scenario.store["EndTime"] = funcs.get_timestamp(
27+
10,
28+
)
2229

2330
# 查询VPC信息
2431
describe_vpc_00(ustack_client)
@@ -358,7 +365,9 @@ def describe_vm_instance_07(step, client):
358365

359366
d = {
360367
"Zone": variables.get("Zone"),
361-
"VMIDs": [variables.get("VMID"),],
368+
"VMIDs": [
369+
variables.get("VMID"),
370+
],
362371
"Region": variables.get("Region"),
363372
}
364373

@@ -388,7 +397,9 @@ def describe_vm_instance_08(step, client):
388397

389398
d = {
390399
"Zone": variables.get("Zone"),
391-
"VMIDs": [variables.get("VMID_1"),],
400+
"VMIDs": [
401+
variables.get("VMID_1"),
402+
],
392403
"Region": variables.get("Region"),
393404
}
394405

@@ -488,7 +499,9 @@ def describe_certificate_11(step, client):
488499
"Zone": variables.get("Zone"),
489500
"Region": variables.get("Region"),
490501
"CertificateType": "ServerCrt",
491-
"CertificateIDs": [variables.get("CertificateID_server"),],
502+
"CertificateIDs": [
503+
variables.get("CertificateID_server"),
504+
],
492505
}
493506

494507
try:
@@ -519,7 +532,9 @@ def describe_certificate_12(step, client):
519532
"Zone": variables.get("Zone"),
520533
"Region": variables.get("Region"),
521534
"CertificateType": "CACrt",
522-
"CertificateIDs": [variables.get("CertificateID_client"),],
535+
"CertificateIDs": [
536+
variables.get("CertificateID_client"),
537+
],
523538
}
524539

525540
try:

ucloud/core/auth/_cfg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CredentialSchema(schema.Schema):
1111

1212

1313
def verify_ac(private_key: str, params: dict) -> str:
14-
""" calculate signature by private_key/public_key
14+
"""calculate signature by private_key/public_key
1515
1616
the keys can be found on `APIKey documentation <https://console.ucloud.cn/uapi/apikey>`__
1717
@@ -39,7 +39,7 @@ def verify_ac(private_key: str, params: dict) -> str:
3939

4040

4141
class Credential:
42-
""" credential is the object to store credential information
42+
"""credential is the object to store credential information
4343
4444
the keys can be found on `APIKey documentation <https://console.ucloud.cn/uapi/apikey>`__
4545

ucloud/core/client/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(
3838
self._middleware = middleware
3939

4040
def invoke(self, action: str, args: dict = None, **options) -> dict:
41-
""" invoke will invoke the action with arguments data and options
41+
"""invoke will invoke the action with arguments data and options
4242
4343
:param str action: the api action, like `CreateUHostInstance`
4444
:param dict args: arguments of api(action), see doc: `UCloud API Documentation <https://docs.ucloud.cn/api>`__

ucloud/core/transport/_requests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class RequestsTransport(http.Transport):
13-
""" transport is the implementation of http client, use for send a request and return a http response
13+
"""transport is the implementation of http client, use for send a request and return a http response
1414
1515
:type max_retries: int
1616
:param max_retries: max retries is the max number of transport request when occur http error
@@ -35,7 +35,7 @@ def __init__(
3535
self._middleware = Middleware()
3636

3737
def send(self, req: Request, **options: typing.Any) -> http.Response:
38-
""" send request and return the response
38+
"""send request and return the response
3939
4040
:param req: the full http request descriptor
4141
:return: the response of http request
@@ -57,7 +57,7 @@ def send(self, req: Request, **options: typing.Any) -> http.Response:
5757

5858
@property
5959
def middleware(self) -> Middleware:
60-
""" the middleware object, see :mod:
60+
"""the middleware object, see :mod:
6161
6262
:return: the transport middleware
6363
"""

ucloud/core/transport/http.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ def __init__(
6363
self.request_uuid = self.headers.get(REQUEST_UUID_HEADER_KEY)
6464

6565
def json(self, **kwargs) -> typing.Optional[dict]:
66-
""" json will return the bytes of content
67-
"""
66+
"""json will return the bytes of content"""
6867
if not self.content:
6968
return None
7069

@@ -77,7 +76,7 @@ def json(self, **kwargs) -> typing.Optional[dict]:
7776

7877
@property
7978
def text(self):
80-
""" text will return the unicode string of content,
79+
"""text will return the unicode string of content,
8180
see `requests.Response.text`
8281
"""
8382
if not self.content:

ucloud/core/transport/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
def guess_json_utf(data):
10-
""" guess_json_utf will detect the encoding of bytes,
10+
"""guess_json_utf will detect the encoding of bytes,
1111
see `requests.utils.guess_json_utf`
1212
1313
:rtype: str

ucloud/core/typesystem/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
class List(abstract.Field):
11-
""" array param is the custom field to parse custom param such as:
11+
"""array param is the custom field to parse custom param such as:
1212
1313
- IP.N
1414
- UDisk.N.Size

ucloud/core/utils/deco.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
def deprecated(instead_of="", message=""):
8-
""" deprecated is a decorator to mark a function is deprecated.
8+
"""deprecated is a decorator to mark a function is deprecated.
99
it will logging warning when this function called
1010
1111
>>> @deprecated(instead_of="new_function")

ucloud/core/utils/middleware.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Middleware:
2-
""" middleware is the object to store request/response handlers
2+
"""middleware is the object to store request/response handlers
33
44
>>> middleware = Middleware()
55
@@ -27,7 +27,7 @@ def __init__(self):
2727
self.exception_handlers = []
2828

2929
def request(self, handler, index=-1):
30-
""" request is the request handler register to add request handler.
30+
"""request is the request handler register to add request handler.
3131
3232
:param handler: request handler function, receive request object
3333
and return a new request
@@ -39,7 +39,7 @@ def request(self, handler, index=-1):
3939
return handler
4040

4141
def response(self, handler, index=-1):
42-
""" response is the response handler register to add response handler.
42+
"""response is the response handler register to add response handler.
4343
4444
:param handler: response handler function, receive response object
4545
and return a new response
@@ -51,7 +51,7 @@ def response(self, handler, index=-1):
5151
return handler
5252

5353
def exception(self, handler, index=-1):
54-
""" exception is the exception handler register to add exception handler.
54+
"""exception is the exception handler register to add exception handler.
5555
5656
:param handler: exception handler function, receive exception object
5757
and raise a new exception or ignore it

0 commit comments

Comments
 (0)