Added unit tests for make_contiguous function
@@ -11,3 +11,14 @@ class ToolsTest():
randomized_im = ps.tools.randomize_colors(im=im)
assert sp.unique(im).size == sp.unique(randomized_im).size
assert sp.all(sp.unique(im) == sp.unique(randomized_im))
+
+ def test_make_contiguous_size(self):
+ im = sp.random.randint(0, 10, 20)
+ cont_im = ps.tools.make_contiguous(im)
+ assert sp.unique(im).size == sp.unique(cont_im).size
+
+ def test_make_contiguous_contiguity(self):
+ im = sp.random.randint(0, 10, 20)
+ cont_im = ps.tools.make_contiguous(im)
+ assert sp.all(sp.arange(sp.unique(im).size) == sp.unique(cont_im))
+
\ No newline at end of file
