Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Thomas Leymonerie
slapos.core
Commits
c7f44b93
Commit
c7f44b93
authored
Oct 04, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
1546d0cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
slapos/entry.py
slapos/entry.py
+1
-1
slapos/tests/entry.py
slapos/tests/entry.py
+15
-5
No files found.
slapos/entry.py
View file @
c7f44b93
...
...
@@ -132,7 +132,7 @@ def dispatch(command, is_node_command):
elif
command
==
'stop'
:
raise
EntryPointNotImplementedError
(
command
)
elif
command
==
'console'
:
c
onsole
(
)
c
all
(
console
,
config
=
USER_SLAPOS_CONFIGURATION
)
else
:
return
False
...
...
slapos/tests/entry.py
View file @
c7f44b93
...
...
@@ -127,11 +127,14 @@ class TestCall (BasicMixin, unittest.TestCase):
options
=
[
"--logfile /opt/slapos/logfile"
,
"--pidfile /opt/slapos/pidfile"
]
config
=
'/etc/opt/slapos/slapos.cfg'
entry
.
call
(
fun
,
config
=
config
,
option
=
options
)
try
:
entry
.
call
(
fun
,
config
=
config
,
option
=
options
)
except
SystemExit
,
e
:
self
.
assertEqual
(
e
[
0
],
0
)
self
.
assertNotEqual
(
original_sysargv
,
sys
.
argv
)
for
x
in
options
:
self
.
assertTrue
(
x
in
" "
.
join
(
sys
.
argv
))
self
.
assertEqual
(
config
,
sys
.
argv
[
len
(
sys
.
argv
)
-
1
])
self
.
assertEqual
(
config
,
sys
.
argv
[
1
])
def
test_config_and_missing_option_are_added
(
self
):
"""
...
...
@@ -149,12 +152,15 @@ class TestCall (BasicMixin, unittest.TestCase):
options
=
[
default_present_option
,
missing_option
]
config
=
'/etc/opt/slapos/slapos.cfg'
entry
.
call
(
fun
,
config
=
config
,
option
=
options
)
try
:
entry
.
call
(
fun
,
config
=
config
,
option
=
options
)
except
SystemExit
,
e
:
self
.
assertEqual
(
e
[
0
],
0
)
self
.
assertNotEqual
(
original_sysargv
,
sys
.
argv
)
for
x
in
(
missing_option
,
present_option
):
self
.
assertTrue
(
x
in
" "
.
join
(
sys
.
argv
))
self
.
assertFalse
(
default_present_option
in
" "
.
join
(
sys
.
argv
))
self
.
assertEqual
(
config
,
sys
.
argv
[
len
(
sys
.
argv
)
-
1
])
self
.
assertEqual
(
config
,
sys
.
argv
[
1
])
def
test_present_config_and_option_are_not_added
(
self
):
"""
...
...
@@ -173,5 +179,9 @@ class TestCall (BasicMixin, unittest.TestCase):
options
=
[
default_present_option
]
config
=
'/etc/opt/slapos/slapos.cfg'
entry
.
call
(
fun
,
config
=
config
,
option
=
options
)
try
:
entry
.
call
(
fun
,
config
=
config
,
option
=
options
)
except
SystemExit
,
e
:
self
.
assertEqual
(
e
[
0
],
0
)
self
.
assertEqual
(
original_sysargv
,
sys
.
argv
)
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