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
Roque
slapos.core
Commits
b175699c
Commit
b175699c
authored
Aug 11, 2011
by
Lucas Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used a list instead of dict and more precise.
parent
912ea18c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
slapos/tests/slapobject.py
slapos/tests/slapobject.py
+23
-17
No files found.
slapos/tests/slapobject.py
View file @
b175699c
...
@@ -9,10 +9,12 @@ import sys
...
@@ -9,10 +9,12 @@ import sys
class
FakeCallAndRead
:
class
FakeCallAndRead
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
external_command_
dict
=
{}
self
.
external_command_
list
=
[]
def
__call__
(
self
,
*
args
,
**
kwargs
):
def
__call__
(
self
,
*
args
,
**
kwargs
):
self
.
external_command_dict
.
update
(
kwargs
)
additional_buildout_parametr_list
=
\
kwargs
.
get
(
'additional_buildout_parametr_list'
)
self
.
external_command_list
.
extend
(
additional_buildout_parametr_list
)
FakeCallAndRead
=
FakeCallAndRead
()
FakeCallAndRead
=
FakeCallAndRead
()
utils
.
bootstrapBuildout
=
FakeCallAndRead
utils
.
bootstrapBuildout
=
FakeCallAndRead
...
@@ -32,7 +34,7 @@ class TestSoftwareSlapObject(BasicMixin, unittest.TestCase):
...
@@ -32,7 +34,7 @@ class TestSoftwareSlapObject(BasicMixin, unittest.TestCase):
def
tearDown
(
self
):
def
tearDown
(
self
):
BasicMixin
.
tearDown
(
self
)
BasicMixin
.
tearDown
(
self
)
FakeCallAndRead
.
external_command_
dict
=
{}
FakeCallAndRead
.
external_command_
list
=
[]
# Test methods
# Test methods
def
test_software_install_with_networkcache
(
self
):
def
test_software_install_with_networkcache
(
self
):
...
@@ -50,13 +52,15 @@ class TestSoftwareSlapObject(BasicMixin, unittest.TestCase):
...
@@ -50,13 +52,15 @@ class TestSoftwareSlapObject(BasicMixin, unittest.TestCase):
software
.
install
()
software
.
install
()
additional_buildout_parameter
=
' '
.
join
(
command_list
=
FakeCallAndRead
.
external_command_list
FakeCallAndRead
.
external_command_dict
.
\
self
.
assertTrue
(
'buildout:networkcache-section=networkcache'
get
(
'additional_buildout_parametr_list'
))
in
command_list
)
self
.
assertTrue
(
'networkcache'
in
additional_buildout_parameter
)
self
.
assertTrue
(
'networkcache:signature-private-key-file=%s'
%
self
.
assertTrue
(
self
.
upload_cache_url
in
additional_buildout_parameter
)
self
.
signature_private_key_file
in
command_list
)
self
.
assertTrue
(
self
.
upload_dir_url
in
additional_buildout_parameter
)
self
.
assertTrue
(
'networkcache:upload-cache-url=%s'
%
self
.
upload_cache_url
self
.
assertTrue
(
self
.
signature_private_key_file
in
additional_buildout_parameter
)
in
command_list
)
self
.
assertTrue
(
'networkcache:upload-dir-url=%s'
%
self
.
upload_dir_url
in
command_list
)
def
test_software_install_without_networkcache
(
self
):
def
test_software_install_without_networkcache
(
self
):
"""
"""
...
@@ -71,10 +75,12 @@ class TestSoftwareSlapObject(BasicMixin, unittest.TestCase):
...
@@ -71,10 +75,12 @@ class TestSoftwareSlapObject(BasicMixin, unittest.TestCase):
software
.
install
()
software
.
install
()
additional_buildout_parameter
=
' '
.
join
(
FakeCallAndRead
.
\
command_list
=
FakeCallAndRead
.
external_command_list
external_command_dict
.
\
self
.
assertFalse
(
'buildout:networkcache-section=networkcache'
get
(
'additional_buildout_parametr_list'
))
in
command_list
)
self
.
assertFalse
(
'networkcache'
in
additional_buildout_parameter
)
self
.
assertFalse
(
'networkcache:signature-private-key-file=%s'
%
self
.
assertFalse
(
self
.
upload_cache_url
in
additional_buildout_parameter
)
self
.
signature_private_key_file
in
command_list
)
self
.
assertFalse
(
self
.
upload_dir_url
in
additional_buildout_parameter
)
self
.
assertFalse
(
'networkcache:upload-cache-url=%s'
%
self
.
upload_cache_url
self
.
assertFalse
(
self
.
signature_private_key_file
in
additional_buildout_parameter
)
in
command_list
)
self
.
assertFalse
(
'networkcache:upload-dir-url=%s'
%
self
.
upload_dir_url
in
command_list
)
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