1. Marcus von Appen
  2. py-sdl2

Source

py-sdl2 / sdl2 / test / sdlimage_test.py

Diff from to

File sdl2/test/sdlimage_test.py

             self.assertIsInstance(sf.contents, surface.SDL_Surface)
             surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_Load_RW(self):
         fname = "surfacetest.%s"
         for fmt in formats:
         render.SDL_DestroyRenderer(rd)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadTexture_RW(self):
         sf = surface.SDL_CreateRGBSurface(0, 10, 10, 32, 0, 0, 0, 0)
         rd = render.SDL_CreateSoftwareRenderer(sf)
         render.SDL_DestroyRenderer(rd)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadTextureTyped_RW(self):
         sf = surface.SDL_CreateRGBSurface(0, 10, 10, 32, 0, 0, 0, 0)
         rd = render.SDL_CreateSoftwareRenderer(sf)
         render.SDL_DestroyRenderer(rd)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadTyped_RW(self):
         fname = "surfacetest.%s"
         for fmt in formats:
             self.assertIsInstance(sf.contents, surface.SDL_Surface)
             surface.SDL_FreeSurface(sf)
 
-    def test_IMG_LoadBMP_rw(self):
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
+    def test_IMG_LoadBMP_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.bmp"), "rb")
         sf = sdlimage.IMG_LoadBMP_RW(rwops.rw_from_object(fp))
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadCUR_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.cur"), "rb")
         surface.SDL_FreeSurface(sf)
         pass
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadGIF_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.gif"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadICO_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.ico"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadJPG_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.jpg"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadLBM_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.lbm"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadPCX_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.pcx"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadPNG_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.png"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadPNM_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.pnm"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadTGA_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.tga"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadTIF_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.tif"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadWEBP_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.webp"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadXCF_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.xcf"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_LoadXPM_RW(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.xpm"), "rb")
         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isBMP(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isBMP(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isCUR(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isCUR(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isGIF(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isGIF(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isICO(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isICO(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isJPG(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isJPG(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isLBM(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isLBM(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isPCX(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isPCX(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isPNG(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isPNG(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isPNM(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isPNM(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isTIF(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isTIF(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isWEBP(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isWEBP(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isXCF(self):
         fname = "surfacetest.%s"
         for fmt in formats:
                 self.assertFalse(sdlimage.IMG_isXCF(imgrw))
             fp.close()
 
+    @unittest.skipIf(sys.platform=="cli", "IronPython can't handle RW objects")
     def test_IMG_isXPM(self):
         fname = "surfacetest.%s"
         for fmt in formats:
 
     @unittest.skipIf(hasattr(sys, "pypy_version_info"),
                      "PyPy's ctypes fails to pass a correct string array")
+    @unittest.skipIf(sys.platform=="cli",
+                     "IronPython can't handle byte() objects")
     def test_IMG_ReadXPMFromArray(self):
         fp = open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                "resources", "surfacetest.xpm"), "rb")