Exemplo n.º 1
0
 def test_set_oversized_data(self):
     data = np.zeros((10, 10), dtype=np.uint8)
     T = Texture(data=data)
     T.set_data(np.ones((20, 20)))
     assert T.shape == (20, 20)
     assert len(T._pending_data) == 1
Exemplo n.º 2
0
 def test_set_misshaped_data(self):
     data = np.zeros(10, dtype=np.uint8)
     T = Texture(data=data)
     with self.assertRaises(ValueError):
         T.set_data(np.ones((10, 10)))
Exemplo n.º 3
0
 def test_set_misplaced_data(self):
     data = np.zeros((10, 10), dtype=np.uint8)
     T = Texture(data=data)
     with self.assertRaises(ValueError):
         T.set_data(np.ones((5, 5)), offset=(8, 8))
Exemplo n.º 4
0
 def test_set_oversized_data(self):
     data = np.zeros((10,10), dtype=np.uint8)
     T = Texture(data=data)
     T.set_data( np.ones((20,20)) )
     assert T.shape == (20,20)
     assert len(T._pending_data) == 1
Exemplo n.º 5
0
 def test_set_misshaped_data(self):
     data = np.zeros(10, dtype=np.uint8)
     T = Texture(data=data)
     with self.assertRaises(ValueError):
         T.set_data( np.ones((10,10)))
Exemplo n.º 6
0
 def test_set_misplaced_data(self):
     data = np.zeros((10,10), dtype=np.uint8)
     T = Texture(data=data)
     with self.assertRaises(ValueError):
         T.set_data( np.ones((5,5)), offset=(8,8) )