def test_trim_zeros_multi(test_a, test_b): """Test passing multiple arguments to trim_zeros""" a_test, a_expect = test_a b_test, b_expect = test_b a_list, b_list = list(a_test), list(b_test) rpm._trim_zeros(a_list, b_list) res_a, res_b = ''.join(a_list), ''.join(b_list) assert a_expect == res_a assert b_expect == res_b
def test_trim_zeros_multi(self): test_strs = [ (('0012', '12'), ('120', '120')), (('04', '4'), ('0', '')) ] for test_a, test_b in test_strs: a_test, a_expect = test_a b_test, b_expect = test_b a_list, b_list = list(a_test), list(b_test) rpm._trim_zeros(a_list, b_list) res_a, res_b = ''.join(a_list), ''.join(b_list) self.assertEqual(a_expect, res_a) self.assertEqual(b_expect, res_b)
def test_trim_zeros(self): test_strs = [ ('0012', '12'), ('120', '120'), ('000000000005', '5'), ('101', '101'), ('0000', '') ] for test, expect in test_strs: test_list = list(test) rpm._trim_zeros(test_list) res = ''.join(test_list) self.assertEqual(expect, res)
def test_trim_zeros(test, expect): """Test that zeros are trimmed as expected""" test_list = list(test) rpm._trim_zeros(test_list) res = ''.join(test_list) assert expect == res