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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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
class
FakeCallAndRead
:
def
__init__
(
self
):
self
.
external_command_
dict
=
{}
self
.
external_command_
list
=
[]
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
()
utils
.
bootstrapBuildout
=
FakeCallAndRead
...
...
@@ -32,7 +34,7 @@ class TestSoftwareSlapObject(BasicMixin, unittest.TestCase):
def
tearDown
(
self
):
BasicMixin
.
tearDown
(
self
)
FakeCallAndRead
.
external_command_
dict
=
{}
FakeCallAndRead
.
external_command_
list
=
[]
# Test methods
def
test_software_install_with_networkcache
(
self
):
...
...
@@ -50,13 +52,15 @@ class TestSoftwareSlapObject(BasicMixin, unittest.TestCase):
software
.
install
()
additional_buildout_parameter
=
' '
.
join
(
FakeCallAndRead
.
external_command_dict
.
\
get
(
'additional_buildout_parametr_list'
))
self
.
assertTrue
(
'networkcache'
in
additional_buildout_parameter
)
self
.
assertTrue
(
self
.
upload_cache_url
in
additional_buildout_parameter
)
self
.
assertTrue
(
self
.
upload_dir_url
in
additional_buildout_parameter
)
self
.
assertTrue
(
self
.
signature_private_key_file
in
additional_buildout_parameter
)
command_list
=
FakeCallAndRead
.
external_command_list
self
.
assertTrue
(
'buildout:networkcache-section=networkcache'
in
command_list
)
self
.
assertTrue
(
'networkcache:signature-private-key-file=%s'
%
self
.
signature_private_key_file
in
command_list
)
self
.
assertTrue
(
'networkcache:upload-cache-url=%s'
%
self
.
upload_cache_url
in
command_list
)
self
.
assertTrue
(
'networkcache:upload-dir-url=%s'
%
self
.
upload_dir_url
in
command_list
)
def
test_software_install_without_networkcache
(
self
):
"""
...
...
@@ -71,10 +75,12 @@ class TestSoftwareSlapObject(BasicMixin, unittest.TestCase):
software
.
install
()
additional_buildout_parameter
=
' '
.
join
(
FakeCallAndRead
.
\
external_command_dict
.
\
get
(
'additional_buildout_parametr_list'
))
self
.
assertFalse
(
'networkcache'
in
additional_buildout_parameter
)
self
.
assertFalse
(
self
.
upload_cache_url
in
additional_buildout_parameter
)
self
.
assertFalse
(
self
.
upload_dir_url
in
additional_buildout_parameter
)
self
.
assertFalse
(
self
.
signature_private_key_file
in
additional_buildout_parameter
)
command_list
=
FakeCallAndRead
.
external_command_list
self
.
assertFalse
(
'buildout:networkcache-section=networkcache'
in
command_list
)
self
.
assertFalse
(
'networkcache:signature-private-key-file=%s'
%
self
.
signature_private_key_file
in
command_list
)
self
.
assertFalse
(
'networkcache:upload-cache-url=%s'
%
self
.
upload_cache_url
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