mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +01:00
fix(immutability) swagger test case
Signed-off-by: Ziming Zhang <zziming@vmware.com>
This commit is contained in:
parent
be58c1d3ff
commit
5bff3e94a0
@ -2234,7 +2234,7 @@ paths:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/RetentionRule'
|
||||
$ref: '#/definitions/ImmutableRule'
|
||||
'400':
|
||||
description: Illegal format of provided ID value.
|
||||
'401':
|
||||
@ -2254,11 +2254,11 @@ paths:
|
||||
format: int64
|
||||
required: true
|
||||
description: Relevant project ID.
|
||||
- name: RetentionRule
|
||||
- name: ImmutableRule
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/RetentionRule'
|
||||
$ref: '#/definitions/ImmutableRule'
|
||||
tags:
|
||||
- Products
|
||||
responses:
|
||||
@ -2288,11 +2288,11 @@ paths:
|
||||
format: int64
|
||||
required: true
|
||||
description: Immutable tag rule ID.
|
||||
- name: RetentionRule
|
||||
- name: ImmutableRule
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/RetentionRule'
|
||||
$ref: '#/definitions/ImmutableRule'
|
||||
tags:
|
||||
- Products
|
||||
responses:
|
||||
@ -4189,6 +4189,46 @@ definitions:
|
||||
type: string
|
||||
description: Webhook supportted notify type.
|
||||
example: 'http'
|
||||
ImmutableRule:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
priority:
|
||||
type: integer
|
||||
disabled:
|
||||
type: boolean
|
||||
action:
|
||||
type: string
|
||||
template:
|
||||
type: string
|
||||
params:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: object
|
||||
tag_selectors:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/ImmutableSelector'
|
||||
scope_selectors:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/ImmutableSelector'
|
||||
|
||||
ImmutableSelector:
|
||||
type: object
|
||||
properties:
|
||||
kind:
|
||||
type: string
|
||||
decoration:
|
||||
type: string
|
||||
pattern:
|
||||
type: string
|
||||
extras:
|
||||
type: string
|
||||
|
||||
parameters:
|
||||
query:
|
||||
name: q
|
||||
|
@ -10,7 +10,7 @@ class Tag_Immutability(base.Base):
|
||||
selector_tag="**", expect_status_code = 201, **kwargs):
|
||||
#repoExcludes,excludes
|
||||
client = self._get_client(**kwargs)
|
||||
retention_rule = swagger_client.RetentionRule(
|
||||
immutable_rule = swagger_client.ImmutableRule(
|
||||
action="immutable",
|
||||
template="immutable_template",
|
||||
priority = 0,
|
||||
@ -32,7 +32,7 @@ class Tag_Immutability(base.Base):
|
||||
]
|
||||
)
|
||||
try:
|
||||
_, status_code, header = client.projects_project_id_immutabletagrules_post_with_http_info(project_id, retention_rule)
|
||||
_, status_code, header = client.projects_project_id_immutabletagrules_post_with_http_info(project_id, immutable_rule)
|
||||
except ApiException as e:
|
||||
base._assert_status_code(expect_status_code, e.status)
|
||||
else:
|
||||
|
@ -149,6 +149,10 @@ Test Case - Proxy Cache
|
||||
[Tags] proxy_cache
|
||||
Harbor API Test ./tests/apitests/python/test_proxy_cache.py
|
||||
|
||||
Test Case - Tag Immutability
|
||||
[Tags] tag_immutability
|
||||
Harbor API Test ./tests/apitests/python/test_tag_immutability.py
|
||||
|
||||
Test Case - P2P
|
||||
[Tags] p2p
|
||||
Harbor API Test ./tests/apitests/python/test_p2p.py
|
||||
|
Loading…
Reference in New Issue
Block a user