def test_compare_blocks(self): test_blocks = [ ('12345', '12345', 0), ('12345', '1234', 1), ('1234', '12345', -1), ('12345', '12346', -1), ('12346', '12345', 1), ('0012', '0012', 0), ('00123', '0012', 1), ('0012', '00123', -1), ('00123', '00124', -1), ('00124', '00123', 1) ] for a, b, exp in test_blocks: list_a, list_b = list(a), list(b) res = rpm._compare_blocks(list_a, list_b) self.assertEqual(exp, res, msg='Got {0} when comparing {1} to ' '{2}'.format(res, a, b))
def test_compare_blocks(block_a, block_b, exp): """Test block comparison""" list_a, list_b = list(block_a), list(block_b) res = rpm._compare_blocks(list_a, list_b) assert exp == res