[python-dtcwt] 195/497: add some basic tests for dtcwt.utils

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:06:03 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository python-dtcwt.

commit da853a798827deddec7e147c2816660827747350
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Mon Nov 11 19:18:11 2013 +0000

    add some basic tests for dtcwt.utils
    
    This increases our coverage for dtcwt.utils to a respectable level.
---
 tests/testutils.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/testutils.py b/tests/testutils.py
new file mode 100644
index 0000000..8939b6a
--- /dev/null
+++ b/tests/testutils.py
@@ -0,0 +1,21 @@
+import numpy as np
+
+from dtcwt.utils import drawedge, drawcirc, appropriate_complex_type_for
+
+def test_complex_type_for_complex():
+    assert np.issubsctype(appropriate_complex_type_for(np.zeros((2,3), np.complex64)), np.complex64)
+    assert np.issubsctype(appropriate_complex_type_for(np.zeros((2,3), np.complex128)), np.complex128)
+
+def test_complex_type_for_float():
+    assert np.issubsctype(appropriate_complex_type_for(np.zeros((2,3), np.float32)), np.complex64)
+    assert np.issubsctype(appropriate_complex_type_for(np.zeros((2,3), np.float64)), np.complex128)
+
+def test_draw_circ():
+    c = drawcirc(20, 4, -4, -5, 50)
+    assert c.shape == (50, 50)
+    assert c[45,45] == 0
+    assert c[25,25] == 1
+
+def test_draw_edge():
+    e = drawedge(20, (20,20), 4, 50)
+    assert e.shape == (50, 50)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-dtcwt.git



More information about the debian-science-commits mailing list