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
Léo-Paul Géneau
slapos.core
Commits
959f7c74
Commit
959f7c74
authored
Aug 07, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consider update line.
parent
2cd31483
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
6 deletions
+36
-6
master/product/Vifib/tests/testVifibDefaultUseCase.py
master/product/Vifib/tests/testVifibDefaultUseCase.py
+36
-6
No files found.
master/product/Vifib/tests/testVifibDefaultUseCase.py
View file @
959f7c74
...
@@ -481,7 +481,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -481,7 +481,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
# 1 invoice line is expected
# 1 invoice line is expected
invoice_line_list
=
sale_invoice
.
contentValues
(
invoice_line_list
=
sale_invoice
.
contentValues
(
portal_type
=
"Invoice Line"
)
portal_type
=
"Invoice Line"
)
self
.
assertEquals
(
3
,
len
(
invoice_line_list
))
self
.
assertEquals
(
4
,
len
(
invoice_line_list
))
service_line
=
[
x
for
x
in
invoice_line_list
\
service_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_setup'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_setup'
][
0
]
...
@@ -489,6 +489,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -489,6 +489,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
if
x
.
getResource
()
==
'service_module/vifib_instance_subscription'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_subscription'
][
0
]
hosting_line
=
[
x
for
x
in
invoice_line_list
\
hosting_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_hosting'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_hosting'
][
0
]
update_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_update'
][
0
]
self
.
assertEquals
(
True
,
service_line
.
hasPrice
())
self
.
assertEquals
(
True
,
service_line
.
hasPrice
())
self
.
assertAlmostEquals
(
0
,
service_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0
,
service_line
.
getPrice
(),
3
)
...
@@ -502,6 +504,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -502,6 +504,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self
.
assertAlmostEquals
(
0
,
hosting_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0
,
hosting_line
.
getPrice
(),
3
)
self
.
assertEquals
(
1
,
hosting_line
.
getQuantity
())
self
.
assertEquals
(
1
,
hosting_line
.
getQuantity
())
self
.
assertEquals
(
True
,
update_line
.
hasPrice
())
self
.
assertAlmostEquals
(
0
,
update_line
.
getPrice
(),
3
)
self
.
assertEquals
(
1
,
update_line
.
getQuantity
())
# 0 transaction line
# 0 transaction line
transaction_line_list
=
sale_invoice
.
contentValues
(
transaction_line_list
=
sale_invoice
.
contentValues
(
portal_type
=
"Sale Invoice Transaction Line"
)
portal_type
=
"Sale Invoice Transaction Line"
)
...
@@ -567,7 +573,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -567,7 +573,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
# 1 invoice line is expected
# 1 invoice line is expected
invoice_line_list
=
sale_invoice
.
contentValues
(
invoice_line_list
=
sale_invoice
.
contentValues
(
portal_type
=
"Invoice Line"
)
portal_type
=
"Invoice Line"
)
self
.
assertEquals
(
4
,
len
(
invoice_line_list
))
self
.
assertEquals
(
5
,
len
(
invoice_line_list
))
service_line
=
[
x
for
x
in
invoice_line_list
\
service_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_setup'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_setup'
][
0
]
...
@@ -577,6 +583,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -577,6 +583,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
if
x
.
getResource
()
==
'service_module/vifib_instance_hosting'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_hosting'
][
0
]
destroy_line
=
[
x
for
x
in
invoice_line_list
\
destroy_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_cleanup'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_cleanup'
][
0
]
update_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_update'
][
0
]
self
.
assertEquals
(
True
,
service_line
.
hasPrice
())
self
.
assertEquals
(
True
,
service_line
.
hasPrice
())
self
.
assertAlmostEquals
(
0
,
service_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0
,
service_line
.
getPrice
(),
3
)
...
@@ -594,6 +602,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -594,6 +602,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self
.
assertAlmostEquals
(
0
,
destroy_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0
,
destroy_line
.
getPrice
(),
3
)
self
.
assertEquals
(
1
,
destroy_line
.
getQuantity
())
self
.
assertEquals
(
1
,
destroy_line
.
getQuantity
())
self
.
assertEquals
(
True
,
update_line
.
hasPrice
())
self
.
assertAlmostEquals
(
0
,
update_line
.
getPrice
(),
3
)
self
.
assertEquals
(
2
,
update_line
.
getQuantity
())
# 0 transaction line
# 0 transaction line
transaction_line_list
=
sale_invoice
.
contentValues
(
transaction_line_list
=
sale_invoice
.
contentValues
(
portal_type
=
"Sale Invoice Transaction Line"
)
portal_type
=
"Sale Invoice Transaction Line"
)
...
@@ -653,10 +665,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -653,10 +665,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self
.
assertAlmostEquals
(
self
.
assertAlmostEquals
(
1
,
sale_invoice
.
getTotalPrice
(),
3
)
1
,
sale_invoice
.
getTotalPrice
(),
3
)
#
5
invoice lines are expected
#
6
invoice lines are expected
invoice_line_list
=
sale_invoice
.
contentValues
(
invoice_line_list
=
sale_invoice
.
contentValues
(
portal_type
=
"Invoice Line"
)
portal_type
=
"Invoice Line"
)
self
.
assertEquals
(
5
,
len
(
invoice_line_list
))
self
.
assertEquals
(
6
,
len
(
invoice_line_list
))
service_line
=
[
x
for
x
in
invoice_line_list
\
service_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_setup'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_setup'
][
0
]
...
@@ -666,6 +678,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -666,6 +678,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
if
x
.
getResource
()
==
'service_module/vifib_instance_hosting'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_hosting'
][
0
]
destroy_line
=
[
x
for
x
in
invoice_line_list
\
destroy_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_cleanup'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_cleanup'
][
0
]
update_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_update'
][
0
]
tax_line
=
[
x
for
x
in
invoice_line_list
\
tax_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_tax'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_tax'
][
0
]
...
@@ -685,6 +699,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -685,6 +699,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self
.
assertAlmostEquals
(
0
,
destroy_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0
,
destroy_line
.
getPrice
(),
3
)
self
.
assertEquals
(
1
,
destroy_line
.
getQuantity
())
self
.
assertEquals
(
1
,
destroy_line
.
getQuantity
())
self
.
assertEquals
(
True
,
update_line
.
hasPrice
())
self
.
assertAlmostEquals
(
0
,
update_line
.
getPrice
(),
3
)
self
.
assertEquals
(
2
,
update_line
.
getQuantity
())
self
.
assertEquals
(
True
,
tax_line
.
hasPrice
())
self
.
assertEquals
(
True
,
tax_line
.
hasPrice
())
self
.
assertAlmostEquals
(
0.196
,
tax_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0.196
,
tax_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0.836
,
tax_line
.
getQuantity
(),
3
)
self
.
assertAlmostEquals
(
0.836
,
tax_line
.
getQuantity
(),
3
)
...
@@ -826,7 +844,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -826,7 +844,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
# 5 invoice lines are expected
# 5 invoice lines are expected
invoice_line_list
=
sale_invoice
.
contentValues
(
invoice_line_list
=
sale_invoice
.
contentValues
(
portal_type
=
"Invoice Line"
)
portal_type
=
"Invoice Line"
)
self
.
assertEquals
(
5
,
len
(
invoice_line_list
))
self
.
assertEquals
(
6
,
len
(
invoice_line_list
))
service_line
=
[
x
for
x
in
invoice_line_list
\
service_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_setup'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_setup'
][
0
]
...
@@ -836,6 +854,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -836,6 +854,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
if
x
.
getResource
()
==
'service_module/vifib_instance_hosting'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_hosting'
][
0
]
destroy_line
=
[
x
for
x
in
invoice_line_list
\
destroy_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_cleanup'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_cleanup'
][
0
]
update_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_update'
][
0
]
tax_line
=
[
x
for
x
in
invoice_line_list
\
tax_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_tax'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_tax'
][
0
]
...
@@ -855,6 +875,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -855,6 +875,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self
.
assertAlmostEquals
(
0
,
destroy_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0
,
destroy_line
.
getPrice
(),
3
)
self
.
assertEquals
(
1
,
destroy_line
.
getQuantity
())
self
.
assertEquals
(
1
,
destroy_line
.
getQuantity
())
self
.
assertEquals
(
True
,
update_line
.
hasPrice
())
self
.
assertAlmostEquals
(
0
,
update_line
.
getPrice
(),
3
)
self
.
assertEquals
(
2
,
update_line
.
getQuantity
())
self
.
assertEquals
(
True
,
tax_line
.
hasPrice
())
self
.
assertEquals
(
True
,
tax_line
.
hasPrice
())
self
.
assertAlmostEquals
(
0.196
,
tax_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0.196
,
tax_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0.836
,
tax_line
.
getQuantity
(),
3
)
self
.
assertAlmostEquals
(
0.836
,
tax_line
.
getQuantity
(),
3
)
...
@@ -1133,7 +1157,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -1133,7 +1157,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
# 5 invoice lines are expected
# 5 invoice lines are expected
invoice_line_list
=
sale_invoice
.
contentValues
(
invoice_line_list
=
sale_invoice
.
contentValues
(
portal_type
=
"Invoice Line"
)
portal_type
=
"Invoice Line"
)
self
.
assertEquals
(
5
,
len
(
invoice_line_list
))
self
.
assertEquals
(
6
,
len
(
invoice_line_list
))
service_line
=
[
x
for
x
in
invoice_line_list
\
service_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_setup'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_setup'
][
0
]
...
@@ -1143,6 +1167,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -1143,6 +1167,8 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
if
x
.
getResource
()
==
'service_module/vifib_instance_hosting'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_hosting'
][
0
]
destroy_line
=
[
x
for
x
in
invoice_line_list
\
destroy_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_cleanup'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_instance_cleanup'
][
0
]
update_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_instance_update'
][
0
]
tax_line
=
[
x
for
x
in
invoice_line_list
\
tax_line
=
[
x
for
x
in
invoice_line_list
\
if
x
.
getResource
()
==
'service_module/vifib_tax'
][
0
]
if
x
.
getResource
()
==
'service_module/vifib_tax'
][
0
]
...
@@ -1162,6 +1188,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
...
@@ -1162,6 +1188,10 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
self
.
assertAlmostEquals
(
0
,
destroy_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0
,
destroy_line
.
getPrice
(),
3
)
self
.
assertEquals
(
2
,
destroy_line
.
getQuantity
())
self
.
assertEquals
(
2
,
destroy_line
.
getQuantity
())
self
.
assertEquals
(
True
,
update_line
.
hasPrice
())
self
.
assertAlmostEquals
(
0
,
update_line
.
getPrice
(),
3
)
self
.
assertEquals
(
6
,
update_line
.
getQuantity
())
self
.
assertEquals
(
True
,
tax_line
.
hasPrice
())
self
.
assertEquals
(
True
,
tax_line
.
hasPrice
())
self
.
assertAlmostEquals
(
0.196
,
tax_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
0.196
,
tax_line
.
getPrice
(),
3
)
self
.
assertAlmostEquals
(
1.672
,
tax_line
.
getQuantity
(),
3
)
self
.
assertAlmostEquals
(
1.672
,
tax_line
.
getQuantity
(),
3
)
...
...
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