Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
barry cho
Rancher
Commits
7197cb24
Commit
7197cb24
authored
6 years ago
by
Daishan Peng
Committed by
Craig Jellick
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
add test
parent
3fa3502b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/core/test_catalog.py
+46
-0
tests/core/test_catalog.py
with
46 additions
and
0 deletions
+46
-0
tests/core/test_catalog.py
0 → 100644
+
46
-
0
View file @
7197cb24
from
.common
import
random_str
import
time
def
test_catalog
(
admin_mc
):
client
=
admin_mc
.
client
name
=
random_str
()
url
=
"https://github.com/StrongMonkey/charts-1.git"
catalog
=
client
.
create_catalog
(
name
=
name
,
branch
=
"test"
,
url
=
url
,
)
wait_for_template_to_be_created
(
client
,
name
)
client
.
delete
(
catalog
)
wait_for_template_to_be_deleted
(
client
,
name
)
def
wait_for_template_to_be_created
(
client
,
name
,
timeout
=
45
):
found
=
False
start
=
time
.
time
()
interval
=
0.5
while
not
found
:
if
time
.
time
()
-
start
>
timeout
:
raise
AssertionError
(
"Timed out waiting for templates"
)
templates
=
client
.
list_template
(
catalogId
=
name
)
if
len
(
templates
)
>
0
:
found
=
True
time
.
sleep
(
interval
)
interval
*=
2
def
wait_for_template_to_be_deleted
(
client
,
name
,
timeout
=
45
):
found
=
False
start
=
time
.
time
()
interval
=
0.5
while
not
found
:
if
time
.
time
()
-
start
>
timeout
:
raise
AssertionError
(
"Timed out waiting for templates"
)
templates
=
client
.
list_template
(
catalogId
=
name
)
if
len
(
templates
)
==
0
:
found
=
True
time
.
sleep
(
interval
)
interval
*=
2
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment