def test_ImageFormatException(self): """test image format exception ......................""" fake_img = TestUtil.get_debug_image("fake.mrc") e = EMData() if(IS_TEST_EXCEPTION): try: e.read_image(fake_img) except RuntimeError as runtime_err: err_type = exception_type(runtime_err) self.assertEqual(err_type, "FileAccessException")
def test_FileAccessException(self): """test file access exception .......................""" e = EMData() e.set_size(10, 10, 1) if(IS_TEST_EXCEPTION): try: e.read_image("__notexistingfile__.mrc") except RuntimeError as runtime_err: err_type = exception_type(runtime_err) self.assertEqual(err_type, "FileAccessException")
def test_NotExistingObjectException(self): """test not existing object exception ...............""" e = EMData() e.set_size(100, 100, 1) if(IS_TEST_EXCEPTION): try: e.process_inplace("NotExistintFilter_kfjda") except RuntimeError as runtime_err: err_type = exception_type(runtime_err) self.assertEqual(err_type, "NotExistingObjectException")