def test_reordering_cube(self): """ Test the order is changed when reordering is required.""" self.cube.cell_methods = (self.cell_methods[1], self.cell_methods[0]) # Test that following the manual reorder above the cube cell methods # and the tuple don't match. self.assertNotEqual(self.cube.cell_methods, self.cell_methods) _order_cell_methods(self.cube) # Test that they do match once sorting has occured. self.assertEqual(self.cube.cell_methods, self.cell_methods)
def test_no_reordering_cube(self): """ Test the order is preserved is no reordering required.""" _order_cell_methods(self.cube) self.assertEqual(self.cube.cell_methods, self.cell_methods)