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
d71fc3b2
Commit
d71fc3b2
authored
Jun 20, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
2b6466c0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
36 deletions
+21
-36
slapos/test/promise/plugin/test_check_file_state.py
slapos/test/promise/plugin/test_check_file_state.py
+14
-24
slapos/test/promise/plugin/test_check_url_available.py
slapos/test/promise/plugin/test_check_url_available.py
+5
-10
slapos/test/test_agent.py
slapos/test/test_agent.py
+2
-2
No files found.
slapos/test/promise/plugin/test_check_file_state.py
View file @
d71fc3b2
...
...
@@ -68,17 +68,12 @@ extra_config_dict = {
self
.
launcher
.
run
()
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
self
.
assertEqual
(
result
[
'result'
][
'failed'
],
True
)
if
six
.
PY3
:
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR IsADirectoryError(21, 'Is a directory') "
"during opening and reading file %r"
%
(
filename
,)
)
else
:
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR IOError(21, 'Is a directory') "
"during opening and reading file %r"
%
(
filename
,)
"ERROR %s(21, 'Is a directory') "
"during opening and reading file %r"
%
(
"IsADirectoryError"
if
six
.
PY3
else
"IOError"
,
filename
)
)
def
test_check_file_not_exists
(
self
):
...
...
@@ -94,17 +89,12 @@ extra_config_dict = {
self
.
launcher
.
run
()
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
self
.
assertEqual
(
result
[
'result'
][
'failed'
],
True
)
if
six
.
PY3
:
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR FileNotFoundError(2, 'No such file or directory') "
"during opening and reading file %r"
%
(
filename
,)
)
else
:
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR IOError(2, 'No such file or directory') "
"during opening and reading file %r"
%
(
filename
,)
"ERROR %s(2, 'No such file or directory') "
"during opening and reading file %r"
%
(
"FileNotFoundError"
if
six
.
PY3
else
"IOError"
,
filename
)
)
def
test_check_file_empty
(
self
):
...
...
slapos/test/promise/plugin/test_check_url_available.py
View file @
d71fc3b2
...
...
@@ -275,15 +275,10 @@ class TestCheckUrlAvailable(CheckUrlAvailableMixin):
self
.
launcher
.
run
()
result
=
self
.
getPromiseResult
(
self
.
promise_name
)
self
.
assertEqual
(
result
[
'result'
][
'failed'
],
True
)
if
six
.
PY3
:
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR: Invalid URL 'https://': No host supplied"
)
else
:
self
.
assertEqual
(
result
[
'result'
][
'message'
],
"ERROR: Invalid URL u'https://': No host supplied"
"ERROR: Invalid URL %s'https://': No host supplied"
%
(
''
if
six
.
PY3
else
'u'
)
)
def
test_check_url_malformed
(
self
):
...
...
slapos/test/test_agent.py
View file @
d71fc3b2
...
...
@@ -159,8 +159,8 @@ class TestAutoSTemp(unittest.TestCase):
removes it when deleted.
"""
f
=
AutoSTemp
(
"foo"
)
with
open
(
f
.
name
,
"r"
)
as
f
ile
:
self
.
assertEqual
(
f
ile
.
read
(),
"foo"
)
with
open
(
f
.
name
,
"r"
)
as
f
_
:
self
.
assertEqual
(
f
_
.
read
(),
"foo"
)
fname
=
f
.
name
self
.
assertTrue
(
os
.
path
.
isfile
(
fname
))
del
f
...
...
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