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
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
771aa3d7
Commit
771aa3d7
authored
Aug 12, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement lower level tests.
parent
33e4b989
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
96 additions
and
0 deletions
+96
-0
master/product/Vifib/tests/testVifibSlapWebService.py
master/product/Vifib/tests/testVifibSlapWebService.py
+96
-0
No files found.
master/product/Vifib/tests/testVifibSlapWebService.py
View file @
771aa3d7
...
...
@@ -8199,6 +8199,102 @@ class TestVifibSlapWebService(testVifibMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
########################################
# Software Instance graph helpers
########################################
def
_test_si_tree
(
self
):
software_instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
'Software Instance'
)
self
.
checkDisconnected
=
software_instance
.
checkDisconnected
def
test_si_tree_simple_connected
(
self
):
"""Graph of one element is connected
A
"""
self
.
_test_si_tree
()
graph
=
{
'A'
:
[]}
root
=
'A'
self
.
assertEqual
(
None
,
self
.
checkDisconnected
(
graph
,
root
))
def
test_si_tree_simple_list_connected
(
self
):
"""Graph of list is connected
B->C->A
"""
self
.
_test_si_tree
()
graph
=
{
'A'
:
[],
'B'
:
[
'C'
],
'C'
:
[
'A'
]}
root
=
'B'
self
.
assertEqual
(
None
,
self
.
checkDisconnected
(
graph
,
root
))
def
test_si_tree_complex_connected
(
self
):
"""Tree is connected
B --> A
\
-> C --> D
\
-> E --> F
"""
self
.
_test_si_tree
()
graph
=
{
'A'
:
[],
'B'
:
[
'A'
,
'C'
],
'C'
:
[
'D'
,
'E'
],
'D'
:
[],
'E'
:
[
'F'
],
'F'
:
[],
}
root
=
'B'
self
.
assertEqual
(
None
,
self
.
checkDisconnected
(
graph
,
root
))
def
test_si_tree_simple_list_disconnected
(
self
):
"""Two lists are disconnected
A->B
C
"""
self
.
_test_si_tree
()
graph
=
{
'A'
:
[
'B'
],
'B'
:
[],
'C'
:
[]}
root
=
'A'
from
erp5.document.SoftwareInstance
import
DisconnectedSoftwareTree
self
.
assertRaises
(
DisconnectedSoftwareTree
,
self
.
checkDisconnected
,
graph
,
root
)
# For now limitation of implementation gives false positive
@
expectedFailure
def
test_si_tree_cyclic_connected
(
self
):
"""Cyclic is connected
A<->B
"""
self
.
_test_si_tree
()
graph
=
{
'A'
:
[
'B'
],
'B'
:
[
'A'
]}
root
=
'B'
self
.
assertEqual
(
None
,
self
.
checkDisconnected
(
graph
,
root
))
def
test_si_tree_cyclic_disconnected
(
self
):
"""Two trees, where one is cyclic are disconnected
B --> A
\
-> H
C --> D --> G
\
-> E --> F
"""
self
.
_test_si_tree
()
graph
=
{
'A'
:
[],
'B'
:
[
'A'
,
'H'
],
'C'
:
[
'D'
,
'E'
],
'D'
:
[
'G'
],
'E'
:
[
'F'
],
'F'
:
[],
'G'
:
[],
'H'
:
[],
}
root
=
'B'
from
erp5.document.SoftwareInstance
import
DisconnectedSoftwareTree
self
.
assertRaises
(
DisconnectedSoftwareTree
,
self
.
checkDisconnected
,
graph
,
root
)
########################################
# Other tests
########################################
...
...
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