From dfa613cee88cc7fc5891e1a270b402986ce6bf5b Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Fri, 21 Jun 2019 10:21:18 +0100 Subject: added initial test for random_noise --- Wrappers/Python/test/test_TestData.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 Wrappers/Python/test/test_TestData.py (limited to 'Wrappers') 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) -- cgit v1.2.3