summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xWrappers/Python/test/test_TestData.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Wrappers/Python/test/test_TestData.py b/Wrappers/Python/test/test_TestData.py
new file mode 100755
index 0000000..cb44a07
--- /dev/null
+++ b/Wrappers/Python/test/test_TestData.py
@@ -0,0 +1,18 @@
+from .testclass import CCPiTestClass
+import numpy
+from ccpi.framework import TestData
+import os
+
+
+
+class TestTestData(CCPiTestClass):
+ def test_random_noise(self):
+ #loader = TestData(data_dir=os.path.join(sys.prefix, 'share','ccpi'))
+ #data_dir=os.path.join(os.path.dirname(__file__),'..', 'data')
+ loader = TestData()
+
+ camera = loader.load(TestData.CAMERA)
+
+ noisy_camera = TestData.random_noise(camera, seed=1)
+ norm = (camera-noisy_camera).norm()
+ self.assertAlmostEqual(norm, 48.881268, places=4)