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
6
Merge Requests
6
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
0dc99fa1
Commit
0dc99fa1
authored
Jan 09, 2019
by
Xiaowu Zhang
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
longrequest_promise: change to use assertEqual
parent
5aadeec4
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_check_error_on_zope_longrequest_log.py
...romise/plugin/test_check_error_on_zope_longrequest_log.py
+3
-3
No files found.
slapos/test/promise/plugin/test_check_error_on_zope_longrequest_log.py
View file @
0dc99fa1
...
@@ -73,7 +73,7 @@ extra_config_dict = {
...
@@ -73,7 +73,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
.
assertEqual
s
(
result
[
'result'
][
'message'
],
"ERROR: Site has 6 long request"
)
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR: Site has 6 long request"
)
def
test_02_no_delay_error_threshold
(
self
):
def
test_02_no_delay_error_threshold
(
self
):
content
=
"""from slapos.promise.plugin.check_error_on_zope_longrequest_log import RunPromise
content
=
"""from slapos.promise.plugin.check_error_on_zope_longrequest_log import RunPromise
...
@@ -89,7 +89,7 @@ extra_config_dict = {
...
@@ -89,7 +89,7 @@ extra_config_dict = {
self
.
configureLauncher
()
self
.
configureLauncher
()
self
.
launcher
.
run
()
self
.
launcher
.
run
()
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
self
.
assertEqual
s
(
result
[
'result'
][
'message'
],
"INFO: Site has 6 long request"
)
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"INFO: Site has 6 long request"
)
def
test_03_delay_no_error_threshold
(
self
):
def
test_03_delay_no_error_threshold
(
self
):
content
=
"""from slapos.promise.plugin.check_error_on_zope_longrequest_log import RunPromise
content
=
"""from slapos.promise.plugin.check_error_on_zope_longrequest_log import RunPromise
...
@@ -105,7 +105,7 @@ extra_config_dict = {
...
@@ -105,7 +105,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
.
assertEqual
s
(
result
[
'result'
][
'message'
],
"ERROR: Site has 3 long request"
)
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR: Site has 3 long request"
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
Xiaowu Zhang
@xiaowu.zhang
·
Jan 09, 2019
Developer
!46 (merged)
https://lab.nexedi.com/nexedi/slapos.toolbox/merge_requests/46
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