def setUp(self):
     shader = Mock(vertex_shader="", fragment_shader="")
     self.shader = ShaderController(shader, "blank/blank_shader")
     self.shader.parse_numeric_bindings =\
             create_autospec(self.shader.parse_numeric_bindings, return_value=False)
     self.shader.parse_boolean_bindings =\
             create_autospec(self.shader.parse_boolean_bindings, return_value=False)
     self.shader.parse_array_bindings =\
             create_autospec(self.shader.parse_array_bindings, return_value=False)
 def setUp(self):
     # Clear any file that exists
     self.tearDown()
     # Start with the blank shader
     shader = Mock(vertex_shader="", fragment_shader="")
     self.shader = ShaderController(shader, "blank/blank_shader")
     # Load a different json file
     self.shader.load_key_bindings(loadfile)
     # Save key binds to a new file
     self.shader.save_key_bindings(savefile)
    def setUp(self):
        shader = Mock(vertex_shader="", fragment_shader="")
        self.viewer = ShaderController(shader, "blank/blank_shader")
        self.viewer.init_int_array_binding = create_autospec(self.viewer.init_int_array_binding)
        self.viewer.init_float_array_binding = create_autospec(self.viewer.init_float_array_binding)
        self.viewer.init_bool_array_binding = create_autospec(self.viewer.init_bool_array_binding)
        self.viewer.init_vec2_array_binding = create_autospec(self.viewer.init_vec2_array_binding)
        self.viewer.init_vec3_array_binding = create_autospec(self.viewer.init_vec3_array_binding)
        self.viewer.init_vec4_array_binding = create_autospec(self.viewer.init_vec4_array_binding)

        self.uniform = TestCreateArrayBinding.mockUniform()
    def __init__(self, shader_path):
        '''
        Load and attempt to run the shader at shader_path.
        '''
        self.w = 512
        self.h = 512

        # Load shader code
        vspath = '%s.v.glsl' % shader_path
        fspath = '%s.f.glsl' % shader_path
        with io.open(vspath) as vstrm, io.open(fspath) as fstrm:
            vertexshader = ' '.join(vstrm)
            fragmentshader = ' '.join(fstrm)

        self.shader = Shader(vertexshader, fragmentshader)
        self.shader_controller = ShaderController(self.shader, shader_path)
        super(TextureWindow, self).__init__(caption=shader_path, width=self.w, height=self.h)

        self.create_key_help_labels()
 def setUp(self):
     shader = Mock(vertex_shader="", fragment_shader="")
     self.viewer = ShaderController(shader, "blank/blank_shader")
 def setUp(self):
     shader = Mock(vertex_shader="", fragment_shader="")
     self.viewer = ShaderController(shader, "blank/blank_shader")
     self.uniform = TestSetupIntArray.mockUniform()
     self.binding = {}
 def setUp(self):
     # Start with the blank shader
     shader = Mock(vertex_shader="", fragment_shader="")
     self.shader = ShaderController(shader, "blank/blank_shader")
     # Load a different json file
     self.shader.load_key_bindings(loadfile)
 def setUp(self):
     shader = Mock(vertex_shader="", fragment_shader="")
     self.shader = ShaderController(shader, "blank/blank_shader")
     self.shader.create_binding = create_autospec(self.shader.create_binding)
     self.uniform = TestCheckShaderBinding.mockUniform()
 def setUp(self):
     shader = Mock(vertex_shader="", fragment_shader="")
     self.shader = ShaderController(shader, "blank/blank_shader")
     self.shader.update_binding = create_autospec(self.shader.update_binding)
 def setUp(self):
     # Ensure there's no json for blank
     self.tearDown()
     shader = Mock(vertex_shader="", fragment_shader="")
     self.shader_controller = ShaderController(shader, "blank/blank_shader")