import unittest

import ModernGL


class TestCase(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        cls.ctx = ModernGL.create_standalone_context()

    @classmethod
    def tearDownClass(cls):
        cls.ctx.release()

    def test_texture(self):
        self.ctx.texture((64, 64), 3)

    def test_multisample_texture(self):
        self.ctx.texture((64, 64), 3, samples=2)

    def test_depth_texture(self):
        self.ctx.depth_texture((64, 64))

    def test_multisample_depth_texture(self):
        self.ctx.depth_texture((64, 64), samples=2)

    def test_texture_invalid_samples(self):
        with self.assertRaisesRegex(ModernGL.Error, 'sample'):
            self.ctx.texture((64, 64), 3, samples=3)


if __name__ == '__main__':
    unittest.main()

@@ -284,30 +284,30 @@
 tx.texture((
-64, 64
+16, 16
 ), 3)%0A%0A    d
@@ -359,38 +359,38 @@
 lf.ctx.texture((
-64, 64
+16, 16
 ), 3, samples=2)
@@ -457,22 +457,22 @@
 exture((
-64, 64
+16, 16
 ))%0A%0A    
@@ -545,22 +545,22 @@
 exture((
-64, 64
+16, 16
 ), sampl
@@ -707,14 +707,14 @@
 re((
-64, 64
+16, 16
 ), 3
@@ -727,16 +727,621 @@
 les=3)%0A%0A
+    def test_texture_get_swizzle(self):%0A        tex = self.ctx.texture((16, 16), 4)%0A        self.assertEqual(tex.swizzle, 'RGBA')%0A%0A    def test_texture_swizzle_1(self):%0A        tex = self.ctx.texture((16, 16), 4)%0A        tex.swizzle = 'argb'%0A        self.assertEqual(tex.swizzle, 'ARGB')%0A%0A    def test_texture_swizzle_2(self):%0A        tex = self.ctx.texture((16, 16), 1)%0A        tex.swizzle = 'RRRR'%0A        self.assertEqual(tex.swizzle, 'RRRR')%0A%0A    def test_texture_swizzle_3(self):%0A        tex = self.ctx.texture((16, 16), 2)%0A        tex.swizzle = '01RG'%0A        self.assertEqual(tex.swizzle, '01RG')%0A%0A
 %0Aif __na

test texture swizzle