MCPcopy Index your code
hub / github.com/numpy/numpy / content_check

Method content_check

numpy/_core/tests/test_unicode.py:54–65  ·  view source on GitHub ↗
(self, ua, ua_scalar, nbytes)

Source from the content-addressed store, hash-verified

52 """Check the creation of zero-valued arrays"""
53
54 def content_check(self, ua, ua_scalar, nbytes):
55
56 # Check the length of the unicode base type
57 assert_(int(ua.dtype.str[2:]) == self.ulen)
58 # Check the length of the data buffer
59 assert_(buffer_length(ua) == nbytes)
60 # Small check that data in array element is ok
61 assert_(ua_scalar == '')
62 # Encode to ascii and double check
63 assert_(ua_scalar.encode('ascii') == b'')
64 # Check buffer lengths for scalars
65 assert_(buffer_length(ua_scalar) == 0)
66
67 def test_zeros0D(self):
68 # Check creation of 0-dimensional objects

Callers 3

test_zeros0DMethod · 0.95
test_zerosSDMethod · 0.95
test_zerosMDMethod · 0.95

Calls 3

assert_Function · 0.90
buffer_lengthFunction · 0.85
encodeMethod · 0.80

Tested by

no test coverage detected