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 Gambier
slapos.core
Commits
c46b4aa5
Commit
c46b4aa5
authored
Feb 14, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only one subscription packing list is created.
parent
f79ce163
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
65 deletions
+51
-65
master/product/Vifib/tests/testVifibInstanceHostingRelatedDocument.py
...ct/Vifib/tests/testVifibInstanceHostingRelatedDocument.py
+51
-65
No files found.
master/product/Vifib/tests/testVifibInstanceHostingRelatedDocument.py
View file @
c46b4aa5
...
...
@@ -117,7 +117,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
.
getSimulationState
())
setup_invoice_line_list
=
catalog
(
portal_type
=
'Invoice Line'
,
aggregate_relative_url
=
hosting_subscription_url
,
resource_relative_url
=
setup_resource
)
self
.
assertEqual
(
1
,
len
(
setup_invoice_line_list
))
self
.
assertEqual
(
'planned'
,
setup_invoice_line_list
[
0
]
\
...
...
@@ -131,8 +130,8 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
sort_on
=
((
'movement.start_date'
,
'desc'
),)
)
self
.
assertEqual
(
2
,
len
(
subscription_delivery_line_list
))
self
.
assertEqual
([
'
confirmed'
]
*
2
,
[
q
.
getSimulationState
()
for
\
self
.
assertEqual
(
1
,
len
(
subscription_delivery_line_list
))
self
.
assertEqual
([
'
delivered'
]
,
[
q
.
getSimulationState
()
for
\
q
in
subscription_delivery_line_list
])
subscription_invoice_line_list
=
catalog
(
portal_type
=
'Invoice Line'
,
...
...
@@ -145,8 +144,9 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
self
.
assertEqual
(
'solved'
,
invoice
.
getCausalityState
())
# invoice shall have causality of one packing list
self
.
assertEqual
(
[
setup_delivery_line_list
[
0
].
getParentValue
().
getUid
()],
self
.
assertSameSet
(
[
setup_delivery_line_list
[
0
].
getParentValue
().
getUid
(),
subscription_delivery_line_list
[
0
].
getParentValue
().
getUid
()],
invoice
.
getCausalityUidList
())
# there shall be no payment transaction related
...
...
@@ -168,14 +168,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
subscription_delivery_uid
=
subscription_delivery_uid
)
def
stepStartSubscriptionDelivery
(
self
,
sequence
,
**
kw
):
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'subscription_delivery_uid'
]).
start
()
def
stepStopSubscriptionDelivery
(
self
,
sequence
,
**
kw
):
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'subscription_delivery_uid'
]).
stop
()
def
stepCheckHostingSubscriptionStoppedDocumentCoverage
(
self
,
sequence
,
**
kw
):
catalog
=
self
.
portal
.
portal_catalog
hosting_subscription
=
catalog
.
getResultValue
(
...
...
@@ -206,7 +198,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
.
getSimulationState
())
setup_invoice_line_list
=
catalog
(
portal_type
=
'Invoice Line'
,
aggregate_relative_url
=
hosting_subscription_url
,
resource_relative_url
=
sequence
[
'setup_resource'
])
self
.
assertEqual
(
1
,
len
(
setup_invoice_line_list
))
self
.
assertEqual
(
'planned'
,
setup_invoice_line_list
[
0
]
\
...
...
@@ -218,13 +209,12 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
aggregate_relative_url
=
hosting_subscription_url
,
resource_relative_url
=
sequence
[
'subscription_resource'
])
self
.
assertEqual
(
2
,
len
(
subscription_delivery_line_list
))
self
.
assertEqual
([
'
confirmed'
]
+
[
'stopp
ed'
],
self
.
assertEqual
(
1
,
len
(
subscription_delivery_line_list
))
self
.
assertEqual
([
'
deliver
ed'
],
sorted
([
q
.
getSimulationState
()
for
\
q
in
subscription_delivery_line_list
]))
subscription_invoice_line_list
=
catalog
(
portal_type
=
'Invoice Line'
,
aggregate_relative_url
=
hosting_subscription_url
,
resource_relative_url
=
sequence
[
'subscription_resource'
])
self
.
assertEqual
(
1
,
len
(
subscription_invoice_line_list
))
self
.
assertEqual
(
'planned'
,
subscription_invoice_line_list
[
0
]
\
...
...
@@ -242,7 +232,7 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
# invoice shall have causality of two packing lists
self
.
assertEqual
(
sorted
([
setup_delivery_line_list
[
0
].
getParentValue
().
getUid
()]
+
[
q
.
getParentValue
().
getUid
()
for
q
in
subscription_delivery_line_list
if
q
.
getSimulationState
()
==
'
stopp
ed'
]),
[
q
.
getParentValue
().
getUid
()
for
q
in
subscription_delivery_line_list
if
q
.
getSimulationState
()
==
'
deliver
ed'
]),
sorted
(
setup_invoice_line_list
[
0
].
getParentValue
().
getCausalityUidList
()))
def
stepSelectPlannedInvoice
(
self
,
sequence
,
**
kw
):
...
...
@@ -251,7 +241,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
invoice_line
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Invoice Line'
,
aggregate_relative_url
=
hosting_subscription
.
getRelativeUrl
(),
simulation_state
=
'planned'
)
...
...
@@ -611,8 +600,6 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
# that invoice got updated
SelectNextSubscriptionDelivery
StartSubscriptionDelivery
StopSubscriptionDelivery
Tic
TriggerBuild
...
...
@@ -633,51 +620,50 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
SelectPlannedInvoice
ConfirmInvoice
Tic
SelectNextSubscriptionDelivery
StartSubscriptionDelivery
StopSubscriptionDelivery
Tic
TriggerBuild
Tic
CheckHostingSubscriptionConfirmedInvoiceDocumentCoverage
# Lets check the payment
StartInvoice
StopInvoice
Tic
TriggerBuild
Tic
CheckHostingSubscriptionStoppedInvoiceDocumentCoverage
# Proof that alarm is capable to stop previous month invoice
SelectPlannedInvoice
InvoiceSetStartDatePreviousMonth
Tic
TriggerConfirmPlannedInvoiceAlarm
Tic
TriggerStopConfirmedInvoiceAlarm
Tic
# Payment should cover both invoices
TriggerBuild
Tic
CheckHostingSubscriptionTwoStoppedInvoiceDocumentCoverage
ConfirmPayment
Tic
CheckPayment
LoginERP5TypeTestCase
CheckSiteConsistency
Logout
"""
# SelectNextSubscriptionDelivery
# Tic
#
# TriggerBuild
# Tic
#
# CheckHostingSubscriptionConfirmedInvoiceDocumentCoverage
#
# # Lets check the payment
#
# StartInvoice
# StopInvoice
# Tic
#
# TriggerBuild
# Tic
#
# CheckHostingSubscriptionStoppedInvoiceDocumentCoverage
#
# # Proof that alarm is capable to stop previous month invoice
# SelectPlannedInvoice
# InvoiceSetStartDatePreviousMonth
# Tic
# TriggerConfirmPlannedInvoiceAlarm
# Tic
# TriggerStopConfirmedInvoiceAlarm
# Tic
#
# # Payment should cover both invoices
# TriggerBuild
# Tic
#
# CheckHostingSubscriptionTwoStoppedInvoiceDocumentCoverage
#
# ConfirmPayment
# Tic
# CheckPayment
#
# LoginERP5TypeTestCase
# CheckSiteConsistency
# Logout
# """
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
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