[#343] Extend testsuites for PATCH method #343
3 changed files with 28 additions and 4 deletions
|
@ -315,8 +315,9 @@ class FrostfsCliObject(CliCommand):
|
|||
ttl: TTL value in request meta header (default 2)
|
||||
wallet: WIF (NEP-2) string or path to the wallet or binary key
|
||||
xhdr: Dict with request X-Headers
|
||||
|
||||
Returns:
|
||||
(str): ID of patched Object
|
||||
Command's result.
|
||||
"""
|
||||
return self._execute(
|
||||
"object patch",
|
||||
|
|
|
@ -21,12 +21,16 @@ class S3HttpClient:
|
|||
self, s3gate_endpoint: str, access_key_id: str, secret_access_key: str, profile: str = "default", region: str = "us-east-1"
|
||||
) -> None:
|
||||
self.http_client = HttpClient()
|
||||
self.s3gate_endpoint = s3gate_endpoint
|
||||
self.credentials = Credentials(access_key_id, secret_access_key)
|
||||
self.profile = profile
|
||||
self.region = region
|
||||
self.service = "s3"
|
||||
self.signature = SigV4Auth(self.credentials, self.service, self.region)
|
||||
|
||||
self.iam_endpoint: str = None
|
||||
self.s3gate_endpoint: str = None
|
||||
self.service: str = None
|
||||
self.signature: SigV4Auth = None
|
||||
|
||||
self.set_endpoint(s3gate_endpoint)
|
||||
|
||||
def _to_s3_header(self, header: str) -> dict:
|
||||
replacement_map = {
|
||||
|
@ -104,6 +108,24 @@ class S3HttpClient:
|
|||
|
||||
return data
|
||||
|
||||
@reporter.step("Set endpoint S3 to {s3gate_endpoint}")
|
||||
def set_endpoint(self, s3gate_endpoint: str):
|
||||
if self.s3gate_endpoint == s3gate_endpoint:
|
||||
return
|
||||
|
||||
self.s3gate_endpoint = s3gate_endpoint
|
||||
self.service = "s3"
|
||||
self.signature = SigV4Auth(self.credentials, self.service, self.region)
|
||||
|
||||
@reporter.step("Set endpoint IAM to {iam_endpoint}")
|
||||
def set_iam_endpoint(self, iam_endpoint: str):
|
||||
if self.iam_endpoint == iam_endpoint:
|
||||
return
|
||||
|
||||
self.iam_endpoint = iam_endpoint
|
||||
self.service = "iam"
|
||||
self.signature = SigV4Auth(self.credentials, self.service, self.region)
|
||||
|
||||
@reporter.step("Patch object S3")
|
||||
def patch_object(
|
||||
self,
|
||||
|
|
|
@ -52,6 +52,7 @@ class Operations:
|
|||
SEARCH_OBJECT = "SearchObject"
|
||||
HEAD_OBJECT = "HeadObject"
|
||||
PUT_OBJECT = "PutObject"
|
||||
PATCH_OBJECT = "PatchObject"
|
||||
|
||||
|
||||
class Verb(HumanReadableEnum):
|
||||
|
|
Loading…
Reference in a new issue