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
1a93df24
Commit
1a93df24
authored
Oct 30, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid code repetition.
A lot of new tests are coming which will use same functionality.
parent
a432d344
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
22 additions
and
74 deletions
+22
-74
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreAllocation.py
...slapos_cloud/TestTemplateItem/testSlapOSCoreAllocation.py
+0
-20
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCorePersonComputerSupply.py
...ud/TestTemplateItem/testSlapOSCorePersonComputerSupply.py
+0
-7
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCorePersonRequest.py
...pos_cloud/TestTemplateItem/testSlapOSCorePersonRequest.py
+0
-7
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCorePersonRequestComputer.py
...d/TestTemplateItem/testSlapOSCorePersonRequestComputer.py
+0
-4
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreSoftwareInstanceRequest.py
...TestTemplateItem/testSlapOSCoreSoftwareInstanceRequest.py
+0
-17
master/bt5/slapos_cloud/bt/revision
master/bt5/slapos_cloud/bt/revision
+1
-1
master/bt5/slapos_slap_tool/TestTemplateItem/testSlapOSSlapTool.py
...5/slapos_slap_tool/TestTemplateItem/testSlapOSSlapTool.py
+0
-17
master/bt5/slapos_slap_tool/bt/revision
master/bt5/slapos_slap_tool/bt/revision
+1
-1
master/product/SlapOS/tests/testSlapOSMixin.py
master/product/SlapOS/tests/testSlapOSMixin.py
+20
-0
No files found.
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreAllocation.py
View file @
1a93df24
...
@@ -6,26 +6,6 @@ from Products.ERP5Type.tests.utils import createZODBPythonScript
...
@@ -6,26 +6,6 @@ from Products.ERP5Type.tests.utils import createZODBPythonScript
class
TestSlapOSAllocation
(
testSlapOSMixin
):
class
TestSlapOSAllocation
(
testSlapOSMixin
):
def
generateNewId
(
self
):
return
self
.
getPortalObject
().
portal_ids
.
generateNewId
(
id_group
=
(
'slapos_core_test'
))
def
generateNewSoftwareReleaseUrl
(
self
):
return
'http://example.org/test%s.cfg'
%
self
.
generateNewId
()
def
generateNewSoftwareType
(
self
):
return
'Type%s'
%
self
.
generateNewId
()
def
generateNewSoftwareTitle
(
self
):
return
'Title%s'
%
self
.
generateNewId
()
def
generateSafeXml
(
self
):
return
'<?xml version="1.0" encoding="utf-8"?><instance><parameter '
\
'id="param">%s</parameter></instance>'
%
self
.
generateNewId
()
def
generateEmptyXml
(
self
):
return
'<?xml version="1.0" encoding="utf-8"?><instance></instance>'
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
super
(
TestSlapOSAllocation
,
self
).
afterSetUp
()
super
(
TestSlapOSAllocation
,
self
).
afterSetUp
()
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
...
...
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCorePersonComputerSupply.py
View file @
1a93df24
...
@@ -7,13 +7,6 @@ from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
...
@@ -7,13 +7,6 @@ from Products.ERP5Type.Errors import UnsupportedWorkflowMethod
class
TestSlapOSCorePersonComputerSupply
(
testSlapOSMixin
):
class
TestSlapOSCorePersonComputerSupply
(
testSlapOSMixin
):
def
generateNewId
(
self
):
return
self
.
getPortalObject
().
portal_ids
.
generateNewId
(
id_group
=
(
'slapos_core_test'
))
def
generateNewSoftwareReleaseUrl
(
self
):
return
'http://example.org/test%s.cfg'
%
self
.
generateNewId
()
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
super
(
TestSlapOSCorePersonComputerSupply
,
self
).
afterSetUp
()
super
(
TestSlapOSCorePersonComputerSupply
,
self
).
afterSetUp
()
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
...
...
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCorePersonRequest.py
View file @
1a93df24
...
@@ -6,13 +6,6 @@ from Products.ERP5Type.tests.backportUnittest import expectedFailure
...
@@ -6,13 +6,6 @@ from Products.ERP5Type.tests.backportUnittest import expectedFailure
class
TestSlapOSCorePersonRequest
(
testSlapOSMixin
):
class
TestSlapOSCorePersonRequest
(
testSlapOSMixin
):
def
generateNewId
(
self
):
return
self
.
getPortalObject
().
portal_ids
.
generateNewId
(
id_group
=
(
'slapos_core_test'
))
def
generateNewSoftwareReleaseUrl
(
self
):
return
'http://example.org/test%s.cfg'
%
self
.
generateNewId
()
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
super
(
TestSlapOSCorePersonRequest
,
self
).
afterSetUp
()
super
(
TestSlapOSCorePersonRequest
,
self
).
afterSetUp
()
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
...
...
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCorePersonRequestComputer.py
View file @
1a93df24
...
@@ -7,10 +7,6 @@ from AccessControl.SecurityManagement import getSecurityManager, \
...
@@ -7,10 +7,6 @@ from AccessControl.SecurityManagement import getSecurityManager, \
class
TestSlapOSCorePersonRequestComputer
(
testSlapOSMixin
):
class
TestSlapOSCorePersonRequestComputer
(
testSlapOSMixin
):
def
generateNewId
(
self
):
return
self
.
getPortalObject
().
portal_ids
.
generateNewId
(
id_group
=
(
'slapos_core_test'
))
def
generateNewComputerTitle
(
self
):
def
generateNewComputerTitle
(
self
):
return
'My Comp %s'
%
self
.
generateNewId
()
return
'My Comp %s'
%
self
.
generateNewId
()
...
...
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreSoftwareInstanceRequest.py
View file @
1a93df24
...
@@ -7,23 +7,6 @@ from Products.ERP5Type.tests.backportUnittest import expectedFailure
...
@@ -7,23 +7,6 @@ from Products.ERP5Type.tests.backportUnittest import expectedFailure
class
TestSlapOSCoreSoftwareInstanceRequest
(
testSlapOSMixin
):
class
TestSlapOSCoreSoftwareInstanceRequest
(
testSlapOSMixin
):
def
generateNewId
(
self
):
return
self
.
getPortalObject
().
portal_ids
.
generateNewId
(
id_group
=
(
'slapos_core_test'
))
def
generateNewSoftwareReleaseUrl
(
self
):
return
'http://example.org/test%s.cfg'
%
self
.
generateNewId
()
def
generateNewSoftwareType
(
self
):
return
'Type%s'
%
self
.
generateNewId
()
def
generateNewSoftwareTitle
(
self
):
return
'Title%s'
%
self
.
generateNewId
()
def
generateSafeXml
(
self
):
return
'<?xml version="1.0" encoding="utf-8"?><instance><parameter '
\
'id="param">%s</parameter></instance>'
%
self
.
generateNewId
()
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
super
(
TestSlapOSCoreSoftwareInstanceRequest
,
self
).
afterSetUp
()
super
(
TestSlapOSCoreSoftwareInstanceRequest
,
self
).
afterSetUp
()
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
...
...
master/bt5/slapos_cloud/bt/revision
View file @
1a93df24
146
147
\ No newline at end of file
\ No newline at end of file
master/bt5/slapos_slap_tool/TestTemplateItem/testSlapOSSlapTool.py
View file @
1a93df24
...
@@ -32,23 +32,6 @@ class Simulator:
...
@@ -32,23 +32,6 @@ class Simulator:
open
(
self
.
outfile
,
'w'
).
write
(
repr
(
l
))
open
(
self
.
outfile
,
'w'
).
write
(
repr
(
l
))
class
TestSlapOSSlapToolMixin
(
testSlapOSMixin
):
class
TestSlapOSSlapToolMixin
(
testSlapOSMixin
):
def
generateNewId
(
self
):
return
self
.
portal
.
portal_ids
.
generateNewId
(
id_group
=
(
'slapos_core_test'
))
def
generateNewSoftwareReleaseUrl
(
self
):
return
'http://example.org/test%s.cfg'
%
self
.
generateNewId
()
def
generateNewSoftwareType
(
self
):
return
'Type%s'
%
self
.
generateNewId
()
def
generateNewSoftwareTitle
(
self
):
return
'Title%s'
%
self
.
generateNewId
()
def
generateSafeXml
(
self
):
return
'<?xml version="1.0" encoding="utf-8"?><instance><parameter '
\
'id="param">%s</parameter></instance>'
%
self
.
generateNewId
()
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
super
(
TestSlapOSSlapToolMixin
,
self
).
afterSetUp
()
super
(
TestSlapOSSlapToolMixin
,
self
).
afterSetUp
()
self
.
portal_slap
=
self
.
portal
.
portal_slap
self
.
portal_slap
=
self
.
portal
.
portal_slap
...
...
master/bt5/slapos_slap_tool/bt/revision
View file @
1a93df24
8
9
\ No newline at end of file
\ No newline at end of file
master/product/SlapOS/tests/testSlapOSMixin.py
View file @
1a93df24
...
@@ -315,6 +315,26 @@ class testSlapOSMixin(Products.Vifib.tests.VifibMixin.testVifibMixin):
...
@@ -315,6 +315,26 @@ class testSlapOSMixin(Products.Vifib.tests.VifibMixin.testVifibMixin):
self
.
portal
.
REQUEST
[
'request_instance'
]
=
None
self
.
portal
.
REQUEST
[
'request_instance'
]
=
None
self
.
portal
.
REQUEST
.
headers
=
{}
self
.
portal
.
REQUEST
.
headers
=
{}
def
generateNewId
(
self
):
return
self
.
portal
.
portal_ids
.
generateNewId
(
id_group
=
(
'slapos_core_test'
))
def
generateNewSoftwareReleaseUrl
(
self
):
return
'http://example.org/test%s.cfg'
%
self
.
generateNewId
()
def
generateNewSoftwareType
(
self
):
return
'Type%s'
%
self
.
generateNewId
()
def
generateNewSoftwareTitle
(
self
):
return
'Title%s'
%
self
.
generateNewId
()
def
generateSafeXml
(
self
):
return
'<?xml version="1.0" encoding="utf-8"?><instance><parameter '
\
'id="param">%s</parameter></instance>'
%
self
.
generateNewId
()
def
generateEmptyXml
(
self
):
return
'<?xml version="1.0" encoding="utf-8"?><instance></instance>'
class
TestSlapOSDummy
(
testSlapOSMixin
):
class
TestSlapOSDummy
(
testSlapOSMixin
):
run_all_test
=
1
run_all_test
=
1
def
test
(
self
):
def
test
(
self
):
...
...
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