Beispiel #1
0
    def test_returns_callable(self):
        from jicbioimage.core.transform import transformation

        def tmp():
            pass

        decorated = transformation(tmp)
        self.assertTrue(callable(decorated))
    def test_auto_safe_dtype(self):
        # AutoSave.auto_safe_type is True by default
        from jicbioimage.core.transform import transformation
        from jicbioimage.core.io import AutoName
        import numpy as np

        AutoName.directory = TMP_DIR

        def some_transform(image):
            return image

        decorated = transformation(some_transform)
        im = np.zeros((50, 50), dtype=np.uint64)

        decorated(im)
        created_fpath = os.path.join(TMP_DIR, '1_some_transform.png')
        self.assertTrue(os.path.isfile(created_fpath),
                        'No such file: {}'.format(created_fpath))
 def test_returns_callable(self):
     from jicbioimage.core.transform import transformation
     def tmp():
         pass
     decorated = transformation(tmp)
     self.assertTrue(callable(decorated))