[pypy-commit] pypy numpy-record-dtypes: (fijal, agaynor) write test

fijal noreply at buildbot.pypy.org
Wed Feb 8 22:50:51 CET 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-record-dtypes
Changeset: r52260:c6a8797f0138
Date: 2012-02-08 22:46 +0100
http://bitbucket.org/pypy/pypy/changeset/c6a8797f0138/

Log:	(fijal, agaynor) write test

diff --git a/pypy/module/micronumpy/test/test_dtypes.py b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -457,12 +457,24 @@
         from _numpypy import dtype
         assert dtype('i4').alignment == 4
 
+class AppTestStrUnicodeDtypes(BaseNumpyAppTest):
     def test_str_unicode(self):
         from _numpypy import str_, unicode_, character, flexible, generic
         
         assert str_.mro() == [str_, str, basestring, character, flexible, generic, object]
         assert unicode_.mro() == [unicode_, unicode, basestring, character, flexible, generic, object]
 
+    def test_str_dtype(self):
+        from _numpypy import dtype, str_
+
+        d = dtype('S8')
+        assert d.itemsize == 8
+        assert dtype(str) == dtype('S')
+        assert d.kind == 'S'
+        assert d.type is str_
+        assert d.name == "string64"
+        assert d.num == 18
+
 class AppTestRecordDtypes(BaseNumpyAppTest):
     def test_create(self):
         from _numpypy import dtype, void


More information about the pypy-commit mailing list