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
Titouan Soulard
slapos.core
Commits
ec28d899
Commit
ec28d899
authored
Jun 06, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor slapobject test mixin.
parent
378c0100
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
14 deletions
+25
-14
slapos/tests/slapobject.py
slapos/tests/slapobject.py
+25
-14
No files found.
slapos/tests/slapobject.py
View file @
ec28d899
...
@@ -55,35 +55,46 @@ originalLaunchBuildout = utils.launchBuildout
...
@@ -55,35 +55,46 @@ originalLaunchBuildout = utils.launchBuildout
originalUploadSoftwareRelease
=
SlapObject
.
Software
.
uploadSoftwareRelease
originalUploadSoftwareRelease
=
SlapObject
.
Software
.
uploadSoftwareRelease
class
TestSoftwareSlapObject
(
BasicMixin
,
unittest
.
TestCase
):
class
MasterMixin
(
BasicMixin
,
unittest
.
TestCase
):
"""
"""
Test for Software clas
s.
Master Mixin of slapobject test classe
s.
"""
"""
def
setUp
(
self
):
def
setUp
(
self
):
BasicMixin
.
setUp
(
self
)
BasicMixin
.
setUp
(
self
)
os
.
mkdir
(
self
.
software_root
)
os
.
mkdir
(
self
.
software_root
)
self
.
signature_private_key_file
=
'/signature/private/key_file'
self
.
upload_cache_url
=
'http://example.com/uploadcache'
self
.
upload_dir_url
=
'http://example.com/uploaddir'
self
.
shacache_cert_file
=
'/path/to/shacache/cert/file'
self
.
shacache_key_file
=
'/path/to/shacache/key/file'
self
.
shadir_cert_file
=
'/path/to/shadir/cert/file'
self
.
shadir_key_file
=
'/path/to/shadir/key/file'
# Monkey patch utils module
# Monkey patch utils module
utils
.
bootstrapBuildout
=
FakeCallAndRead
utils
.
bootstrapBuildout
=
FakeCallAndRead
utils
.
launchBuildout
=
FakeCallAndRead
utils
.
launchBuildout
=
FakeCallAndRead
# Reset external command list in case it is dirty from previous test
FakeCallAndRead
.
external_command_list
=
[]
def
tearDown
(
self
):
def
tearDown
(
self
):
global
originalBootstrapBuildout
global
originalLaunchBuildout
BasicMixin
.
tearDown
(
self
)
BasicMixin
.
tearDown
(
self
)
FakeCallAndRead
.
external_command_list
=
[]
# Un-monkey patch utils module
# Un-monkey patch utils module
global
originalBootstrapBuildout
global
originalLaunchBuildout
utils
.
bootstrapBuildout
=
originalBootstrapBuildout
utils
.
bootstrapBuildout
=
originalBootstrapBuildout
utils
.
launchBuildout
=
originalLaunchBuildout
utils
.
launchBuildout
=
originalLaunchBuildout
class
TestSoftwareNetworkCacheSlapObject
(
MasterMixin
,
unittest
.
TestCase
):
"""
Test for Network Cache related features in Software class.
"""
def
setUp
(
self
):
MasterMixin
.
setUp
(
self
)
self
.
signature_private_key_file
=
'/signature/private/key_file'
self
.
upload_cache_url
=
'http://example.com/uploadcache'
self
.
upload_dir_url
=
'http://example.com/uploaddir'
self
.
shacache_cert_file
=
'/path/to/shacache/cert/file'
self
.
shacache_key_file
=
'/path/to/shacache/key/file'
self
.
shadir_cert_file
=
'/path/to/shadir/cert/file'
self
.
shadir_key_file
=
'/path/to/shadir/key/file'
def
tearDown
(
self
):
MasterMixin
.
tearDown
(
self
)
SlapObject
.
Software
.
_install_from_buildout
=
original_install_from_buildout
SlapObject
.
Software
.
_install_from_buildout
=
original_install_from_buildout
networkcache
.
upload_network_cached
=
original_upload_network_cached
networkcache
.
upload_network_cached
=
original_upload_network_cached
SlapObject
.
Software
.
uploadSoftwareRelease
=
originalUploadSoftwareRelease
SlapObject
.
Software
.
uploadSoftwareRelease
=
originalUploadSoftwareRelease
...
...
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