def test_another_sortment(self): tree = RequirementsTree() tree.add('clear-giftcard', 'clear-giftcard', before=['order-total']) tree.add('item-subtotal', 'item-subtotal') tree.add('item-discount', 'item-discount', before=['order-subtotal', 'taxes'], after=['item-subtotal']) tree.add('clear-substitution', 'clear-substitution', before=['order-total']) tree.add('order-discount', 'order-discount', before=['order-total', 'taxes'], after=['order-subtotal']) tree.add('taxes', 'taxes', before=['order-total'], after=['order-subtotal']) tree.add('shipping', 'shipping', before=['order-total']) tree.add('clear-storecredit', 'clear-storecredit', before=['order-total']) tree.add('order-subtotal', 'order-subtotal', after=['item-subtotal']) tree.add('order-total', 'order-total', after=['order-subtotal']) tree.add('storecredit', 'storecredit', after=['order-total']) tree.add('giftcard', 'giftcard', after=['order-total']) tree.add('substitution', 'substitution', after=['order-total']) self.assert_tree_sortment(tree)
def test_sortment(self): tree = RequirementsTree() tree.add('d', 'd', before=['z'], after=['a']) tree.add('e', 'e', after=['c', 'd']) tree.add('f', 'f', after=['e'], before=['z']) tree.add('a', 'a', before=['d', 'e']) tree.add('b', 'b', after=['a']) tree.add('c', 'c') tree.add('z', 'z') self.assert_tree_sortment(tree)