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
Paul Graydon
slapos.core
Commits
06bbfb4f
Commit
06bbfb4f
authored
Nov 14, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Covert HS constraints.
parent
dcbf5b36
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
1 deletion
+99
-1
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingConstraint.py
...unting/TestTemplateItem/testSlapOSAccountingConstraint.py
+97
-0
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
master/bt5/slapos_accounting/bt/template_test_id_list
master/bt5/slapos_accounting/bt/template_test_id_list
+1
-0
No files found.
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingConstraint.py
0 → 100644
View file @
06bbfb4f
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved.
#
##############################################################################
from
testSlapOSCloudConstraint
import
TestSlapOSConstraintMixin
from
Products.ERP5Type.Base
import
WorkflowMethod
import
transaction
class
TestHostingSubscription
(
TestSlapOSConstraintMixin
):
# use decrator in order to avoid fixing consistency of new object
@
WorkflowMethod
.
disable
def
_createHostingSubscription
(
self
):
self
.
subscription
=
self
.
portal
.
hosting_subscription_module
.
newContent
(
portal_type
=
'Hosting Subscription'
)
def
afterSetUp
(
self
):
super
(
TestHostingSubscription
,
self
).
afterSetUp
()
self
.
_createHostingSubscription
()
def
beforeTearDown
(
self
):
transaction
.
abort
()
super
(
TestHostingSubscription
,
self
).
beforeTearDown
()
def
test_periodicity_hour_list_value
(
self
):
value
=
7
message
=
'Attribute periodicity_hour_list value is [7] but should be [0]'
self
.
assertFalse
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityHour
(
value
)
self
.
assertTrue
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityHour
(
0
)
self
.
assertFalse
(
any
([
q
.
startswith
(
'Attribute periodicity_hour_list value is'
)
\
for
q
in
self
.
getMessageList
(
self
.
subscription
)]))
def
test_periodicity_minute_list_value
(
self
):
value
=
7
message
=
'Attribute periodicity_minute_list value is [7] but should be [0]'
self
.
assertFalse
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityMinute
(
value
)
self
.
assertTrue
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityMinute
(
0
)
self
.
assertFalse
(
any
([
q
.
startswith
(
'Attribute periodicity_minute_list value is'
)
\
for
q
in
self
.
getMessageList
(
self
.
subscription
)]))
def
test_periodicity_month_day_list_lenght
(
self
):
message
=
'There was too many objects in periodicity_month_day_list'
self
.
assertFalse
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityMonthDayList
([
1
,
2
])
self
.
assertTrue
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityMonthDayList
([
1
])
self
.
assertFalse
(
message
in
self
.
getMessageList
(
self
.
subscription
))
def
test_periodicity_month_day_value_range
(
self
):
message
=
'The periodicity_month_day value is not between 1 and 28 '
\
'inclusive'
self
.
assertFalse
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityMonthDay
(
0
)
self
.
assertTrue
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityMonthDay
(
29
)
self
.
assertTrue
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityMonthDay
(
28
)
self
.
assertFalse
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityMonthDay
(
1
)
self
.
assertFalse
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityMonthDay
(
15
)
self
.
assertFalse
(
message
in
self
.
getMessageList
(
self
.
subscription
))
self
.
subscription
.
setPeriodicityMonthDay
(
None
)
self
.
assertFalse
(
message
in
self
.
getMessageList
(
self
.
subscription
))
def
test_periodicity_property
(
self
):
template
=
'Property existence error for property %s, this '
\
'document has no such property or the property has never been set'
self
.
_test_property_existence
(
self
.
subscription
,
'periodicity_hour'
,
template
%
'periodicity_hour'
,
empty_string
=
False
)
self
.
_test_property_existence
(
self
.
subscription
,
'periodicity_minute'
,
template
%
'periodicity_minute'
,
empty_string
=
False
)
self
.
_test_property_existence
(
self
.
subscription
,
'periodicity_month_day'
,
template
%
'periodicity_month_day'
,
empty_string
=
False
)
master/bt5/slapos_accounting/bt/revision
View file @
06bbfb4f
28
29
\ No newline at end of file
\ No newline at end of file
master/bt5/slapos_accounting/bt/template_test_id_list
View file @
06bbfb4f
testSlapOSAccountingConstraint
testSlapOSAccountingHostingSubscriptionSimulation
testSlapOSAccountingHostingSubscriptionSimulation
testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm
testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm
\ 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