utils_38.py 526 B

1234567891011121314151617181920
  1. def _unicode_save(self, temp_file):
  2. im = pygame.Surface((10, 10), 0, 32)
  3. try:
  4. with open(temp_file, "w") as f:
  5. pass
  6. os.remove(temp_file)
  7. except IOError:
  8. raise unittest.SkipTest("the path cannot be opened")
  9. self.assertFalse(os.path.exists(temp_file))
  10. try:
  11. imageext.save_extended(im, temp_file)
  12. self.assertGreater(os.path.getsize(temp_file), 10)
  13. finally:
  14. try:
  15. os.remove(temp_file)
  16. except EnvironmentError:
  17. pass