コード例 #1
0
ファイル: test_variable.py プロジェクト: alexflint/vispy
    def test_set(self):
        uniform = Uniform(None, "A", gl.GL_FLOAT_VEC4)

        uniform.set_data(1)
        assert (uniform.data == 1).all()

        uniform.set_data([1, 2, 3, 4])
        assert (uniform.data == [1, 2, 3, 4]).all()
コード例 #2
0
ファイル: test_variable.py プロジェクト: ds604/vispy
    def test_set_exception(self):
        uniform = Uniform("A", gl.GL_FLOAT_VEC4)

        with self.assertRaises(ValueError):
            uniform.set_data([1,2])

        with self.assertRaises(ValueError):
            uniform.set_data([1,2,3,4,5])
コード例 #3
0
    def test_set(self):
        uniform = Uniform("A", gl.GL_FLOAT_VEC4)

        uniform.set_data(1)
        assert (uniform.data == 1).all()

        uniform.set_data([1, 2, 3, 4])
        assert (uniform.data == [1, 2, 3, 4]).all()
コード例 #4
0
ファイル: test_variable.py プロジェクト: ds604/vispy
    def test_set_exception(self):
        uniform = Uniform("A", gl.GL_FLOAT_VEC4)

        with self.assertRaises(ValueError):
            uniform.set_data([1, 2])

        with self.assertRaises(ValueError):
            uniform.set_data([1, 2, 3, 4, 5])