'Merge in reverse- and forward order with well-defined prioritities'

def test_priority_order(self):

    (a, b, c, d) = (self.cmdset_a, self.cmdset_b, self.cmdset_c, self.cmdset_d)
    a.priority = 2
    b.priority = 1
    c.priority = 0
    d.priority = (-1)
    cmdset_f = (((d + c) + b) + a)
    self.assertEqual(cmdset_f.priority, 2)
    self.assertEqual(cmdset_f.mergetype, 'Union')
    self.assertEqual(len(cmdset_f.commands), 4)
    self.assertTrue(all((True for cmd in cmdset_f.commands if (cmd.from_cmdset == 'A'))))
    cmdset_f = (((a + b) + c) + d)
    self.assertEqual(cmdset_f.priority, 2)
    self.assertEqual(cmdset_f.mergetype, 'Union')
    self.assertEqual(len(cmdset_f.commands), 4)
    self.assertTrue(all((True for cmd in cmdset_f.commands if (cmd.from_cmdset == 'A'))))
