Commit 1eac6784 authored by Yusuke Muraoka's avatar Yusuke Muraoka

Also last path movements must has causality


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27339 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1c71f517
This diff is collapsed.
...@@ -222,18 +222,18 @@ class TestMRPImplementation(TestMRPMixin, ERP5TypeTestCase): ...@@ -222,18 +222,18 @@ class TestMRPImplementation(TestMRPMixin, ERP5TypeTestCase):
# assertion # assertion
expected_value_set = set([ expected_value_set = set([
('business_process_module/1/p2', 'product_module/1', 'mrp/p3', -10), (('business_process_module/1/p2',), 'product_module/1', 'mrp/p3', -10),
('business_process_module/1/p2', 'product_module/2', 'mrp/p2', 30), (('business_process_module/1/p2',), 'product_module/2', 'mrp/p2', 30),
('business_process_module/1/p2', 'product_module/3', 'mrp/p2', 10), (('business_process_module/1/p2',), 'product_module/3', 'mrp/p2', 10),
('business_process_module/1/p3', 'product_module/1', 'mrp/p3', 10), (('business_process_module/1/p3',), 'product_module/1', 'mrp/p3', 10),
('business_process_module/1/p3', 'product_module/4', 'mrp/p3', 40), (('business_process_module/1/p3',), 'product_module/4', 'mrp/p3', 40),
('business_process_module/1/p3', 'product_module/5', 'mrp/p3', 10), (('business_process_module/1/p3',), 'product_module/5', 'mrp/p3', 10),
(None, 'product_module/1', None, -10)]) (('business_process_module/1/p3',), 'product_module/1', None, -10)])
movement_list = applied_rule.objectValues() movement_list = applied_rule.objectValues()
self.assertEquals(len(expected_value_set), len(movement_list)) self.assertEquals(len(expected_value_set), len(movement_list))
movement_value_set = set([]) movement_value_set = set([])
for movement in movement_list: for movement in movement_list:
movement_value_set |= set([(movement.getCausality(), movement_value_set |= set([(tuple(movement.getCausalityList()),
movement.getResource(), movement.getResource(),
movement.getTradePhase(), movement.getTradePhase(),
movement.getQuantity())]) movement.getQuantity())])
...@@ -263,16 +263,16 @@ class TestMRPImplementation(TestMRPMixin, ERP5TypeTestCase): ...@@ -263,16 +263,16 @@ class TestMRPImplementation(TestMRPMixin, ERP5TypeTestCase):
# assertion # assertion
expected_value_set = set([ expected_value_set = set([
('business_process_module/2/p2', 'product_module/2', 'mrp/p2', 30), (('business_process_module/2/p2',), 'product_module/2', 'mrp/p2', 30),
('business_process_module/2/p2', 'product_module/3', 'mrp/p2', 10), (('business_process_module/2/p2',), 'product_module/3', 'mrp/p2', 10),
('business_process_module/2/p3', 'product_module/4', 'mrp/p3', 40), (('business_process_module/2/p3',), 'product_module/4', 'mrp/p3', 40),
('business_process_module/2/p3', 'product_module/5', 'mrp/p3', 10), (('business_process_module/2/p3',), 'product_module/5', 'mrp/p3', 10),
(None, 'product_module/1', None, -10)]) (('business_process_module/2/p2', 'business_process_module/2/p3'), 'product_module/1', None, -10)])
movement_list = applied_rule.objectValues() movement_list = applied_rule.objectValues()
self.assertEquals(len(expected_value_set), len(movement_list)) self.assertEquals(len(expected_value_set), len(movement_list))
movement_value_set = set([]) movement_value_set = set([])
for movement in movement_list: for movement in movement_list:
movement_value_set |= set([(movement.getCausality(), movement_value_set |= set([(tuple(movement.getCausalityList()),
movement.getResource(), movement.getResource(),
movement.getTradePhase(), movement.getTradePhase(),
movement.getQuantity())]) movement.getQuantity())])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment