Esempio n. 1
0
 def test_02_04_EncapsulateStructInCell(self):
     struct = numpy.ndarray((1, 1), dtype=[('foo', object)])
     cell = numpy.ndarray((1, 1), dtype=object)
     cell[0, 0] = struct
     struct['foo'][0, 0] = u'Hello, world'
     u.encapsulate_strings_in_arrays(cell)
     self.assertTrue(isinstance(struct['foo'][0, 0], numpy.ndarray))
     self.assertTrue(struct['foo'][0, 0][0] == u'Hello, world')
Esempio n. 2
0
 def test_02_04_EncapsulateStructInCell(self):
     struct = numpy.ndarray((1,1),dtype=[('foo',object)])
     cell = numpy.ndarray((1,1),dtype=object)
     cell[0,0] = struct
     struct['foo'][0,0] = u'Hello, world'
     u.encapsulate_strings_in_arrays(cell)
     self.assertTrue(isinstance(struct['foo'][0,0],numpy.ndarray))
     self.assertTrue(struct['foo'][0,0][0] == u'Hello, world')
Esempio n. 3
0
 def test_02_03_EncapsulateCellInStruct(self):
     struct = numpy.ndarray((1, 1), dtype=[("foo", object)])
     cell = numpy.ndarray((1, 1), dtype=object)
     cell[0, 0] = u"Hello, world"
     struct["foo"][0, 0] = cell
     u.encapsulate_strings_in_arrays(struct)
     self.assertTrue(isinstance(cell[0, 0], numpy.ndarray))
     self.assertTrue(cell[0, 0][0] == u"Hello, world")
Esempio n. 4
0
 def test_02_01_EncapsulateCell(self):
     cell = numpy.ndarray((1, 1), dtype=object)
     cell[0, 0] = u'Hello, world'
     u.encapsulate_strings_in_arrays(cell)
     self.assertTrue(isinstance(cell[0, 0], numpy.ndarray))
     self.assertTrue(cell[0, 0][0] == u'Hello, world')
Esempio n. 5
0
 def test_02_01_EncapsulateCell(self):
     cell = numpy.ndarray((1,1),dtype=object)
     cell[0,0] = u'Hello, world'
     u.encapsulate_strings_in_arrays(cell)
     self.assertTrue(isinstance(cell[0,0],numpy.ndarray))
     self.assertTrue(cell[0,0][0] == u'Hello, world')