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
Łukasz Nowak
slapos.core
Commits
7e826cdd
Commit
7e826cdd
authored
Nov 06, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move tests to proper module.
parent
6a3f732b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
77 deletions
+68
-77
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreConstraint.py
...slapos_cloud/TestTemplateItem/testSlapOSCoreConstraint.py
+66
-0
master/bt5/slapos_cloud/bt/revision
master/bt5/slapos_cloud/bt/revision
+1
-1
master/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
...er/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
+0
-75
master/bt5/vifib_erp5/bt/revision
master/bt5/vifib_erp5/bt/revision
+1
-1
No files found.
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreConstraint.py
View file @
7e826cdd
...
...
@@ -485,3 +485,69 @@ class TestSlapOSPersonConstraint(testSlapOSMixin):
person
.
newContent
(
portal_type
=
'Email'
)
self
.
assertFalse
(
consistency_message
in
getMessageList
(
person
))
class
TestSlapOSAssignmentConstraint
(
testSlapOSMixin
):
def
test_parent_person_validated
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
consistency_message
=
'The person document has to be validated to start '
\
'assignment'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
assignment
))
person
.
validate
()
self
.
assertFalse
(
consistency_message
in
getMessageList
(
assignment
))
class
TestSlapOSEmailConstraint
(
testSlapOSMixin
):
def
test_url_string_not_empty
(
self
):
email
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
).
newContent
(
portal_type
=
'Email'
)
consistency_message
=
'Email must be defined'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
email
))
email
.
setUrlString
(
self
.
generateNewId
())
self
.
assertFalse
(
consistency_message
in
getMessageList
(
email
))
class
TestSlapOSComputerConstraint
(
testSlapOSMixin
):
def
test_title_not_empty
(
self
):
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
)
consistency_message
=
'Title must be defined'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
computer
))
computer
.
setTitle
(
self
.
generateNewId
())
self
.
assertFalse
(
consistency_message
in
getMessageList
(
computer
))
def
test_reference_not_empty
(
self
):
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
)
consistency_message
=
'Reference must be defined'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
computer
))
computer
.
setReference
(
self
.
generateNewId
())
self
.
assertFalse
(
consistency_message
in
getMessageList
(
computer
))
def
test_reference_unique
(
self
):
reference
=
self
.
generateNewId
()
reference_2
=
self
.
generateNewId
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
,
reference
=
reference
)
computer_2
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
,
reference
=
reference
)
consistency_message
=
'Reference must be unique'
self
.
stepTic
()
self
.
assertTrue
(
consistency_message
in
getMessageList
(
computer
))
self
.
assertTrue
(
consistency_message
in
getMessageList
(
computer_2
))
computer_2
.
setReference
(
reference_2
)
self
.
stepTic
()
self
.
assertFalse
(
consistency_message
in
getMessageList
(
computer
))
self
.
assertFalse
(
consistency_message
in
getMessageList
(
computer_2
))
master/bt5/slapos_cloud/bt/revision
View file @
7e826cdd
218
\ No newline at end of file
219
\ No newline at end of file
master/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
View file @
7e826cdd
...
...
@@ -69,81 +69,6 @@ class TestVifibSoftwareProductConstraint(testVifibMixin):
self
.
assertFalse
(
consistency_message
in
getMessageList
(
software_product
))
self
.
assertFalse
(
consistency_message
in
getMessageList
(
software_product_2
))
class
TestVifibAssignmentConstraint
(
testVifibMixin
):
def
getTitle
(
self
):
return
"Vifib Assignment Constraint checks"
def
test_parent_person_validated
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
consistency_message
=
'The person document has to be validated to start '
\
'assignment'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
assignment
))
person
.
validate
()
self
.
assertFalse
(
consistency_message
in
getMessageList
(
assignment
))
class
TestVifibComputerConstraint
(
testVifibMixin
):
def
getTitle
(
self
):
return
"Vifib Computer Constraint checks"
def
test_title_not_empty
(
self
):
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
)
consistency_message
=
'Title must be defined'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
computer
))
computer
.
setTitle
(
rndstr
())
self
.
assertFalse
(
consistency_message
in
getMessageList
(
computer
))
def
test_reference_not_empty
(
self
):
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
)
consistency_message
=
'Reference must be defined'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
computer
))
computer
.
setReference
(
rndstr
())
self
.
assertFalse
(
consistency_message
in
getMessageList
(
computer
))
def
test_reference_unique
(
self
):
reference
=
rndstr
()
reference_2
=
rndstr
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
,
reference
=
reference
)
computer_2
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
,
reference
=
reference
)
consistency_message
=
'Reference must be unique'
self
.
stepTic
()
self
.
assertTrue
(
consistency_message
in
getMessageList
(
computer
))
self
.
assertTrue
(
consistency_message
in
getMessageList
(
computer_2
))
computer_2
.
setReference
(
reference_2
)
self
.
stepTic
()
self
.
assertFalse
(
consistency_message
in
getMessageList
(
computer
))
self
.
assertFalse
(
consistency_message
in
getMessageList
(
computer_2
))
class
TestVifibEmailConstraint
(
testVifibMixin
):
def
getTitle
(
self
):
return
"Vifib Email Constraint checks"
def
test_url_string_not_empty
(
self
):
email
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
).
newContent
(
portal_type
=
'Email'
)
consistency_message
=
'Email must be defined'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
email
))
email
.
setUrlString
(
rndstr
())
self
.
assertFalse
(
consistency_message
in
getMessageList
(
email
))
class
TestVifibInternalPackingListConstraint
(
testVifibMixin
):
def
getTitle
(
self
):
return
"Vifib Internal Packing List Constraint checks"
...
...
master/bt5/vifib_erp5/bt/revision
View file @
7e826cdd
549
\ No newline at end of file
550
\ No newline at end of file
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