pygame / test / transform_test.py

Diff from to

test/transform_test.py

-import test_utils
-import test.unittest as unittest
+if __name__ == '__main__':
+    import sys
+    import os
+    pkg_dir = os.path.split(os.path.abspath(__file__))[0]
+    parent_dir, pkg_name = os.path.split(pkg_dir)
+    is_pygame_pkg = (pkg_name == 'tests' and
+                     os.path.split(parent_dir)[1] == 'pygame')
+    if not is_pygame_pkg:
+        sys.path.insert(0, parent_dir)
+else:
+    is_pygame_pkg = __name__.startswith('pygame.tests.')
 
-from test_utils import test_not_implemented
-
-import pygame, pygame.transform
+if is_pygame_pkg:
+    from pygame.tests import test_utils
+    from pygame.tests.test_utils import test_not_implemented, unittest
+else:
+    from test import test_utils
+    from test.test_utils import test_not_implemented, unittest
+import pygame
+import pygame.transform
 from pygame.locals import *
 
 import platform
         self.assertEqual( sr.get_flags(), s1.get_flags() )
         self.assertEqual( sr.get_losses(), s1.get_losses() )
 
-        #print ( sr.get_masks(), s1.get_masks() )
-        #print ( sr.get_flags(), s1.get_flags() )
-        #print ( sr.get_losses(), s1.get_losses() )
+        if 0:
+            print ( sr, s1 )
+            print ( sr.get_masks(), s1.get_masks() )
+            print ( sr.get_flags(), s1.get_flags() )
+            print ( sr.get_losses(), s1.get_losses() )
+            print ( sr.get_shifts(), s1.get_shifts() )
 
         self.assertEqual(sr.get_at((0,0)), (10,53,50,255))
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.