code: def test_texture_cube_alignment(gl, check3d):
      """Test that textures set unpack alignment properly.
  
      See https://github.com/vispy/vispy/pull/1758
  
      """
      from ..glir import GlirTextureCube
  
      check3d.return_value = gl
      t = GlirTextureCube(mock.MagicMock(), 3)
  
      shape = (68, 296, 393, 1)
      t.set_size(shape, "luminance", "luminance")
      t.set_data((0, 0, 0), np.zeros(shape, np.float32))
      # alignment should have been 4 which is the default
      gl.glPixelStorei.assert_not_called()
      gl.glPixelStorei.reset_mock()
  
      # now with bytes
      t.set_data((0, 0, 0), np.zeros(shape, np.uint8))
      gl.glPixelStorei.assert_has_calls(
          [
              mock.call(gl.GL_UNPACK_ALIGNMENT, 1),
              mock.call(gl.GL_UNPACK_ALIGNMENT, 4),
          ]
      )
      gl.glPixelStorei.reset_mock()
  
      # different shape
      shape = (68, 296, 394, 1)
      t.set_size(shape, "luminance", "luminance")
      t.set_data((0, 0, 0), np.zeros(shape, np.float32))
      gl.glPixelStorei.assert_has_calls(
          [
              mock.call(gl.GL_UNPACK_ALIGNMENT, 8),
              mock.call(gl.GL_UNPACK_ALIGNMENT, 4),
          ]
      )
      gl.glPixelStorei.reset_mock()
  
      t.set_data((0, 0, 0), np.zeros(shape, np.uint8))
      gl.glPixelStorei.assert_has_calls(
          [
              mock.call(gl.GL_UNPACK_ALIGNMENT, 2),
              mock.call(gl.GL_UNPACK_ALIGNMENT, 4),
          ]
      )
      gl.glPixelStorei.reset_mock()
  
file_path: vispy/vispy/gloo/tests/test_glir.py
imports: import json
  import tempfile
  from unittest import mock
  from vispy import config
  from vispy.app import Canvas
  from vispy.gloo import glir
  from vispy.testing import requires_application, requires_pyopengl, run_tests_if_main
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: test_texture_cube_alignment(gl, check3d) without return types