Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
slapos.toolbox
Commits
e1281991
Commit
e1281991
authored
Nov 08, 2018
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CLEANUP: Use self.assertIn instead of hardcoding length of string
parent
f105ab99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
slapos/test/promise/plugin/test_backupserver_check_backup.py
slapos/test/promise/plugin/test_backupserver_check_backup.py
+3
-3
No files found.
slapos/test/promise/plugin/test_backupserver_check_backup.py
View file @
e1281991
...
@@ -79,7 +79,7 @@ extra_config_dict = {{
...
@@ -79,7 +79,7 @@ extra_config_dict = {{
self
.
launcher
.
run
()
self
.
launcher
.
run
()
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
self
.
assertEquals
(
result
[
'result'
][
'failed'
],
False
)
self
.
assertEquals
(
result
[
'result'
][
'failed'
],
False
)
self
.
assert
Equals
(
result
[
'result'
][
'message'
][:
9
],
"Backup OK"
)
self
.
assert
In
(
"Backup OK"
,
result
[
'result'
][
'message'
]
)
def
test_check_backup_fail
(
self
):
def
test_check_backup_fail
(
self
):
now
=
datetime
.
utcnow
()
now
=
datetime
.
utcnow
()
...
@@ -91,7 +91,7 @@ extra_config_dict = {{
...
@@ -91,7 +91,7 @@ extra_config_dict = {{
with
self
.
assertRaises
(
PromiseError
):
with
self
.
assertRaises
(
PromiseError
):
self
.
launcher
.
run
()
self
.
launcher
.
run
()
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
self
.
assert
Equals
(
result
[
'result'
][
'message'
][:
13
],
"Backup FAILED"
)
self
.
assert
In
(
"Backup FAILED"
,
result
[
'result'
][
'message'
]
)
def
test_check_backup_too_long
(
self
):
def
test_check_backup_too_long
(
self
):
now
=
datetime
.
utcnow
()
now
=
datetime
.
utcnow
()
...
@@ -104,7 +104,7 @@ extra_config_dict = {{
...
@@ -104,7 +104,7 @@ extra_config_dict = {{
self
.
launcher
.
run
()
self
.
launcher
.
run
()
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
self
.
assertEquals
(
result
[
'result'
][
'failed'
],
True
)
self
.
assertEquals
(
result
[
'result'
][
'failed'
],
True
)
self
.
assert
Equals
(
result
[
'result'
][
'message'
][:
35
],
"Backup didn't start at correct time"
)
self
.
assert
In
(
"Backup didn't start at correct time"
,
result
[
'result'
][
'message'
]
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
Write
Preview
Markdown
is supported
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