Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
c9f91fbe
Commit
c9f91fbe
authored
Mar 13, 2019
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caddy-frontend/test: Allow extended msg in assertTestData
parent
4384cd61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
software/caddy-frontend/test/test.py
software/caddy-frontend/test/test.py
+6
-2
No files found.
software/caddy-frontend/test/test.py
View file @
c9f91fbe
...
@@ -273,7 +273,7 @@ class TestDataMixin(object):
...
@@ -273,7 +273,7 @@ class TestDataMixin(object):
'%(group)s:%(name)s %(statename)s'
%
q
for
q
'%(group)s:%(name)s %(statename)s'
%
q
for
q
in
self
.
getSupervisorRPCServer
().
supervisor
.
getAllProcessInfo
()]))
in
self
.
getSupervisorRPCServer
().
supervisor
.
getAllProcessInfo
()]))
def
assertTestData
(
self
,
runtime_data
,
hash_value
=
None
):
def
assertTestData
(
self
,
runtime_data
,
hash_value
=
None
,
msg
=
None
):
filename
=
'%s-%s.txt'
%
(
self
.
id
(),
'CADDY'
)
filename
=
'%s-%s.txt'
%
(
self
.
id
(),
'CADDY'
)
test_data_file
=
os
.
path
.
join
(
test_data_file
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
'test_data'
,
filename
)
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
'test_data'
,
filename
)
...
@@ -288,10 +288,13 @@ class TestDataMixin(object):
...
@@ -288,10 +288,13 @@ class TestDataMixin(object):
maxDiff
=
self
.
maxDiff
maxDiff
=
self
.
maxDiff
self
.
maxDiff
=
None
self
.
maxDiff
=
None
longMessage
=
self
.
longMessage
self
.
longMessage
=
True
try
:
try
:
self
.
assertMultiLineEqual
(
self
.
assertMultiLineEqual
(
test_data
,
test_data
,
runtime_data
runtime_data
,
msg
=
msg
)
)
except
AssertionError
:
except
AssertionError
:
if
os
.
environ
.
get
(
'SAVE_TEST_DATA'
,
'0'
)
==
'1'
:
if
os
.
environ
.
get
(
'SAVE_TEST_DATA'
,
'0'
)
==
'1'
:
...
@@ -299,6 +302,7 @@ class TestDataMixin(object):
...
@@ -299,6 +302,7 @@ class TestDataMixin(object):
raise
raise
finally
:
finally
:
self
.
maxDiff
=
maxDiff
self
.
maxDiff
=
maxDiff
self
.
longMessage
=
longMessage
def
_test_file_list
(
self
,
slave_dir
,
IGNORE_PATH_LIST
):
def
_test_file_list
(
self
,
slave_dir
,
IGNORE_PATH_LIST
):
runtime_data
=
[]
runtime_data
=
[]
...
...
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