def test_rmval(self): expected_list = [ ([1, 2, 3], [2], ([1, 3], [2])), (['a', 'b', 'c'], ['b'], (['a', 'c'], ['b'])), (['a', 'b', 'c'], ['c', 'a'], (['b'], ['c', 'a'])), ([1, 2, 3], ['a'], ([1, 2, 3], [])), ([1, 2, 3], [], ([1, 2, 3], [])), ([], [1, 2, 3], ([], [])), ] for data, tbr, expected in expected_list: self.assertEqual(utils.rmval(data, *tbr), expected)
def test_rmval(self): expected_list = [ ([1,2,3], [2], ([1,3], [2])), (['a','b','c'], ['b'], (['a','c'], ['b'])), (['a','b','c'], ['c', 'a'], (['b'], ['c', 'a'])), ([1,2,3], ['a'], ([1,2,3], [])), ([1,2,3], [], ([1,2,3], [])), ([], [1,2,3], ([], [])), ] for data, tbr, expected in expected_list: self.assertEqual(utils.rmval(data, *tbr), expected)
def impose_ordering(branch_list): branch_list, removed = utils.rmval(branch_list, 'master', 'develop') branch_list.sort() branch_list = removed + branch_list return branch_list