def test_get_block_res(self): test_strs = [ ('12.12', '12.13', 0), ('12.12', 'a.13', 1), ('a12.5', '12.5', -1), ('01ab', '01ac', 0), ('012ab', '02ab', 1), ('abc123', 'abc123', 0), ('abd123', 'abc123', 1) ] for a, b, exp in test_strs: list_a, list_b = list(a), list(b) res = rpm._get_block_result(list_a, list_b) self.assertEqual(exp, res, msg='Got {0} when comparing {1} to ' '{2}'.format(res, a, b))
def test_get_block_res(str_a, str_b, exp): """Test _get_block_res, which returns the result of the first block""" list_a, list_b = list(str_a), list(str_b) res = rpm._get_block_result(list_a, list_b) assert exp == res