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
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.toolbox
Commits
ef159b9d
Commit
ef159b9d
authored
Jun 24, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
b84fb554
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
slapos/test/monitor/testrunpromise.py
slapos/test/monitor/testrunpromise.py
+12
-12
No files found.
slapos/test/monitor/testrunpromise.py
View file @
ef159b9d
...
...
@@ -160,7 +160,7 @@ class RunPromise(GenericPromise):
},
u'path'
:
u'%s/my_promise.py'
%
self
.
promise_dir
,
}
self
.
assertIsNotNone
(
my_result
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
my_result
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
my_result
)
result_file
=
os
.
path
.
join
(
self
.
output_dir
,
'my_second_promise.status.json'
)
...
...
@@ -176,7 +176,7 @@ class RunPromise(GenericPromise):
},
u'path'
:
u'%s/my_second_promise.py'
%
self
.
promise_dir
,
}
self
.
assertIsNotNone
(
second_result
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
second_result
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
second_result
)
def
test_promise_generic_failed
(
self
):
...
...
@@ -198,7 +198,7 @@ class RunPromise(GenericPromise):
},
u'path'
:
u'%s/my_promise.py'
%
self
.
promise_dir
,
}
self
.
assertIsNotNone
(
my_result
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
my_result
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
my_result
)
def
test_promise_generic_status_change
(
self
):
...
...
@@ -220,7 +220,7 @@ class RunPromise(GenericPromise):
},
u'path'
:
u'%s/my_promise.py'
%
self
.
promise_dir
,
}
self
.
assertIsNotNone
(
my_result
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
my_result
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
my_result
)
os
.
system
(
'rm %s/*.pyc'
%
self
.
promise_dir
)
...
...
@@ -240,7 +240,7 @@ class RunPromise(GenericPromise):
},
u'path'
:
u'%s/my_promise.py'
%
self
.
promise_dir
,
}
self
.
assertIsNotNone
(
my_result
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
my_result
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
my_result
)
def
test_promise_generic_periodicity
(
self
):
...
...
@@ -310,7 +310,7 @@ class RunPromise(GenericPromise):
with
open
(
result_file
)
as
f
:
result2
=
json
.
load
(
f
)
start_date2
=
datetime
.
strptime
(
result2
[
'result'
].
pop
(
'date'
),
'%Y-%m-%dT%H:%M:%S+0000'
)
self
.
assertIsNotNone
(
result2
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
result2
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
result2
)
def
test_promise_two_folder
(
self
):
...
...
@@ -336,7 +336,7 @@ class RunPromise(GenericPromise):
},
u'path'
:
u'%s'
%
promise
,
}
self
.
assertIsNotNone
(
result1
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
result1
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
result1
)
with
open
(
result2_file
)
as
f
:
...
...
@@ -350,7 +350,7 @@ class RunPromise(GenericPromise):
},
u'path'
:
u'%s'
%
promise2
,
}
self
.
assertIsNotNone
(
result2
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
result2
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
result2
)
def
test_promise_NOK
(
self
):
...
...
@@ -371,7 +371,7 @@ class RunPromise(GenericPromise):
},
u'path'
:
u'%s'
%
promise
,
}
self
.
assertIsNotNone
(
result1
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
result1
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
result1
)
# second run
...
...
@@ -380,7 +380,7 @@ class RunPromise(GenericPromise):
with
open
(
result_file
)
as
f
:
result2
=
json
.
load
(
f
)
result2
[
'result'
].
pop
(
'date'
)
self
.
assertIsNotNone
(
result2
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
result2
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
result2
)
def
test_promise_mixed
(
self
):
...
...
@@ -401,7 +401,7 @@ class RunPromise(GenericPromise):
},
u'path'
:
u'%s'
%
promise
,
}
self
.
assertIsNotNone
(
result1
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
result1
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
result1
)
# second run with failure
...
...
@@ -416,6 +416,6 @@ class RunPromise(GenericPromise):
with
open
(
result_file
)
as
f
:
result2
=
json
.
load
(
f
)
result2
[
'result'
].
pop
(
'date'
)
self
.
assertIsNotNone
(
result2
.
pop
(
u
'execution-time'
,
None
))
self
.
assertIsNotNone
(
result2
.
pop
(
'execution-time'
,
None
))
self
.
assertEqual
(
expected_result
,
result2
)
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