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
Boxiang Sun
slapos.toolbox
Commits
56b5df0e
Commit
56b5df0e
authored
Sep 11, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: use assertLess for better assertion messages
parent
f4b906ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
slapos/test/test_networkbench.py
slapos/test/test_networkbench.py
+5
-5
No files found.
slapos/test/test_networkbench.py
View file @
56b5df0e
...
@@ -47,7 +47,7 @@ class TestDNSBench(unittest.TestCase):
...
@@ -47,7 +47,7 @@ class TestDNSBench(unittest.TestCase):
self
.
assertEqual
(
info
[
1
],
'eu.web.vifib.com'
)
self
.
assertEqual
(
info
[
1
],
'eu.web.vifib.com'
)
self
.
assertEqual
(
info
[
2
],
200
)
self
.
assertEqual
(
info
[
2
],
200
)
self
.
assert
True
(
info
[
3
]
<
1
)
self
.
assert
Less
(
info
[
3
],
1
)
self
.
assertEqual
(
info
[
4
],
'OK'
,
self
.
assertEqual
(
info
[
4
],
'OK'
,
"%s != OK, full info: %s"
%
(
info
[
4
],
info
)
)
"%s != OK, full info: %s"
%
(
info
[
4
],
info
)
)
self
.
assertEqual
(
set
(
info
[
5
]),
set
([
u'85.118.38.162'
,
u'176.31.129.213'
]),
self
.
assertEqual
(
set
(
info
[
5
]),
set
([
u'85.118.38.162'
,
u'176.31.129.213'
]),
...
@@ -63,7 +63,7 @@ class TestDNSBench(unittest.TestCase):
...
@@ -63,7 +63,7 @@ class TestDNSBench(unittest.TestCase):
self
.
assertEqual
(
info
[
1
],
'thisdomaindontexist.erp5.com'
)
self
.
assertEqual
(
info
[
1
],
'thisdomaindontexist.erp5.com'
)
self
.
assertEqual
(
info
[
2
],
600
)
self
.
assertEqual
(
info
[
2
],
600
)
self
.
assert
True
(
info
[
3
]
<
1
)
self
.
assert
Less
(
info
[
3
],
1
)
self
.
assertEqual
(
info
[
4
],
'Cannot resolve the hostname'
)
self
.
assertEqual
(
info
[
4
],
'Cannot resolve the hostname'
)
self
.
assertEqual
(
info
[
5
],
[])
self
.
assertEqual
(
info
[
5
],
[])
...
@@ -77,7 +77,7 @@ class TestDNSBench(unittest.TestCase):
...
@@ -77,7 +77,7 @@ class TestDNSBench(unittest.TestCase):
self
.
assertEqual
(
info
[
1
],
'www.erp5.com'
)
self
.
assertEqual
(
info
[
1
],
'www.erp5.com'
)
self
.
assertEqual
(
info
[
2
],
200
)
self
.
assertEqual
(
info
[
2
],
200
)
self
.
assert
True
(
info
[
3
]
<
1
)
self
.
assert
Less
(
info
[
3
],
1
)
self
.
assertEqual
(
info
[
4
],
'UNEXPECTED'
)
self
.
assertEqual
(
info
[
4
],
'UNEXPECTED'
)
self
.
assertTrue
(
info
[
5
].
startswith
(
"['85.118.38.162'] (expected) != "
))
self
.
assertTrue
(
info
[
5
].
startswith
(
"['85.118.38.162'] (expected) != "
))
...
@@ -88,7 +88,7 @@ class TestPing(unittest.TestCase):
...
@@ -88,7 +88,7 @@ class TestPing(unittest.TestCase):
self
.
assertEqual
(
info
[
0
],
'PING'
)
self
.
assertEqual
(
info
[
0
],
'PING'
)
self
.
assertEqual
(
info
[
1
],
'localhost'
)
self
.
assertEqual
(
info
[
1
],
'localhost'
)
self
.
assertEqual
(
info
[
2
],
200
)
self
.
assertEqual
(
info
[
2
],
200
)
self
.
assert
True
(
float
(
info
[
3
])
<
0.2
)
self
.
assert
Less
(
float
(
info
[
3
]),
0.2
)
self
.
assertEqual
(
info
[
4
],
'0'
)
self
.
assertEqual
(
info
[
4
],
'0'
)
self
.
assertTrue
(
info
[
5
].
startswith
(
"min"
))
self
.
assertTrue
(
info
[
5
].
startswith
(
"min"
))
...
@@ -107,7 +107,7 @@ class TestPing(unittest.TestCase):
...
@@ -107,7 +107,7 @@ class TestPing(unittest.TestCase):
self
.
assertEqual
(
info
[
0
],
'PING6'
)
self
.
assertEqual
(
info
[
0
],
'PING6'
)
self
.
assertEqual
(
info
[
1
],
'localhost'
)
self
.
assertEqual
(
info
[
1
],
'localhost'
)
self
.
assertEqual
(
info
[
2
],
200
)
self
.
assertEqual
(
info
[
2
],
200
)
self
.
assert
True
(
float
(
info
[
3
])
<
0.2
)
self
.
assert
Less
(
float
(
info
[
3
]),
0.2
)
self
.
assertEqual
(
info
[
4
],
'0'
)
self
.
assertEqual
(
info
[
4
],
'0'
)
self
.
assertTrue
(
info
[
5
].
startswith
(
"min"
))
self
.
assertTrue
(
info
[
5
].
startswith
(
"min"
))
...
...
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