Commit 595f1727 authored by Fabien Morin's avatar Fabien Morin

add a new test to check findSpecialiseValueList results

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27567 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fedb04c0
...@@ -1589,6 +1589,41 @@ class TestBPMTestCases(TestBPMMixin): ...@@ -1589,6 +1589,41 @@ class TestBPMTestCases(TestBPMMixin):
trade_condition_1.getTradeModelLineComposedList() trade_condition_1.getTradeModelLineComposedList()
) )
def test_findSpecialiseValueList(self):
'''
check that findSpecialiseValueList is able to return all the inheritance
model tree using Depth-first search
trade_condition_1
/ \
/ \
/ \
trade_condition_2 trade_condition_3
|
|
|
trade_condition_4
according to Depth-first search algorihm, result of this graph should be
[trade_condition_1, trade_condition_2, trade_condition_3,
trade_condition_4]
'''
trade_condition_1 = self.createTradeCondition()
trade_condition_2 = self.createTradeCondition()
trade_condition_3 = self.createTradeCondition()
trade_condition_4 = self.createTradeCondition()
trade_condition_1.setSpecialiseValueList((trade_condition_2,
trade_condition_3))
trade_condition_2.setSpecialiseValue(trade_condition_4)
speciliase_value_list = trade_condition_1.findSpecialiseValueList(context=\
trade_condition_1)
self.assertEquals(len(speciliase_value_list), 4)
self.assertEquals(
[trade_condition_1, trade_condition_2, trade_condition_3,
trade_condition_4], speciliase_value_list)
def test_TradeConditionTradeModelLineBasicCompositionWithOrder(self): def test_TradeConditionTradeModelLineBasicCompositionWithOrder(self):
""" """
If Trade Condition is specialised by another Trade Condition they If Trade Condition is specialised by another Trade Condition they
......
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