Skip to content

Commit 2fbb1eb

Browse files
committed
adding more tests for shape and len
1 parent 0357843 commit 2fbb1eb

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

wolframclient/tests/serializers/wxf_pythonarray.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,21 @@ def test_python_array(self):
3232
)
3333

3434
def test_generators(self):
35+
36+
array = NumericArray((i for i in range(10)), "Integer8", shape=(10, ))
37+
3538
self.assertEqual(
3639
export(numpy.arange(10).astype(numpy.int8), target_format="wxf"),
37-
export(NumericArray((i for i in range(10)), "Integer8", shape=(10, )), target_format="wxf"),
38-
)
40+
export(array, target_format="wxf"),
41+
)
42+
43+
self.assertEqual(len(array), 10)
44+
45+
array = NumericArray((i for i in range(10)), "Integer8", shape=(5, 2))
46+
47+
self.assertEqual(
48+
export(numpy.arange(10).astype(numpy.int8).reshape(5, 2), target_format="wxf"),
49+
export(array, target_format="wxf"),
50+
)
51+
52+
self.assertEqual(len(array), 10)

0 commit comments

Comments
 (0)