if suite_x in RELEASES_ORDER and suite_y in RELEASES_ORDER:
return RELEASES_ORDER.index(suite_y)-RELEASES_ORDER.index(suite_x)
else:
- return cmp(suite_x, suite_y)
+ return (suite_x > suite_y) - (suite_x < suite_y)
return 0
# Test that sequences not in RELEASES_ORDER lead to reliable output
x[1]['suite'] = rnd_string(1,12)
y[1]['suite'] = rnd_string(1,12)
- supposed_output = cmp(x[1]['suite'],y[1]['suite'])
+ supposed_output = (x[1]['suite'] > y[1]['suite']) - (x[1]['suite'] < y[1]['suite'])
self.assertEqual(lr.compare_release(x,y),
supposed_output,
'compare_release(' + x[1]['suite'] + ',' + y[1]['suite'] + ') =? ' + str(supposed_output))