def test_custom_msg_fail(self): """test the correct exception is raised when the optional msg argument is passed in and the file cannot be found""" os.remove(self.stage) msg = "That file doesn't exist" with self.assertRaisesRegexp(IOError, msg): find_standard_ancil(self.stage, msg)
def test_findstage_fail(self): """test the correct exception is raised when stage ancillaries are not found""" os.remove(self.stage) with self.assertRaisesRegexp(IOError, 'Cannot find input ancillary'): find_standard_ancil(self.stage)
def test_findstage(self): """test case where stage file is present and read""" result = find_standard_ancil(self.stage) self.assertIsInstance(result, Cube)