def test_value_error(self, arguments, image, method):
     if method == "__init__":
         self.assertRaises(ValueError, DetectEnvelope, **arguments)
     elif method == "__call__":
         self.assertRaises(ValueError, DetectEnvelope(**arguments), image)
     else:
         raise ValueError("Expected raising method invalid. Should be __init__ or __call__.")
Beispiel #2
0
 def test_value(self, arguments, image, expected_data, atol):
     for p in TEST_NDARRAYS:
         result = DetectEnvelope(**arguments)(p(image))
         assert_allclose(result,
                         p(expected_data),
                         atol=atol,
                         type_test="tensor")
 def test_invalid_pytorch_error(self):
     with self.assertRaisesRegex(InvalidPyTorchVersionError, "version"):
         DetectEnvelope()
 def test_no_fft_module_error(self):
     self.assertRaises(OptionalImportError, DetectEnvelope(), np.random.rand(1, 10))
 def test_value(self, arguments, image, expected_data, atol):
     result = DetectEnvelope(**arguments)(image)
     np.testing.assert_allclose(result, expected_data, atol=atol)