o 6a@sHdZddlZddlZejjjZejjjZGdddZGdddZ dS)zQ Tests of the ._exceptions module. Primarily for exercising the __str__ methods. Nc@s,eZdZddZddZddZddZd S) TestArrayMemoryErrorcCs6tdttj}tt|}|j|jksJdS)z, Test that _ArrayMemoryError can be pickled N)_ArrayMemoryErrornpdtypeuint8pickleloadsdumps _total_size)selferrorresrC/usr/lib/python3/dist-packages/numpy/core/tests/test__exceptions.py test_pickling sz"TestArrayMemoryError.test_picklingcCstdttj}t|dS)Nr)rrrrstrr errrtest_strs zTestArrayMemoryError.test_strcCs>tj}d}|ddks J|ddksJ|ddksJ||dks%J||ddks/J|d |d ks9J|td |d ksEJ|td |dksQJ|td|dks]J|||dksgJ|t|||ddkswJ|||||||dksJ|||||||ddksJdS)z Test e._size_to_string rz0 bytesz1 bytesrz 1023 bytesz1.00 KiB z10.0 KiBg33333;@z999. KiBg33333@z 1023. KiBg@z1.00 MiBgH.?z1.00 GiBz1.00 EiBi@z 123456. EiBN)r_size_to_stringint)r fKirrrtest__size_to_strings $,z)TestArrayMemoryError.test__size_to_stringcCsHtdttj}|jdksJtdttjdf}|jdks"JdS)z Test e._total_size )rr)rN)rrrrr uint64rrrrtest__total_size.sz%TestArrayMemoryError.test__total_sizeN)__name__ __module__ __qualname__rrrr#rrrrr s  rc@seZdZddZdS)TestUFuncNoLoopErrorcCstttts JdS)z, Test that _UFuncNoLoopError can be pickled N) isinstancer r _UFuncNoLoopErrorbytes)r rrrr8sz"TestUFuncNoLoopError.test_picklingN)r$r%r&rrrrrr'7s r') __doc__r numpyrcore _exceptionsrr)rr'rrrrs  +