Ejemplo n.º 1
0
    def test_devnull(self):
        sandbox = DirectorySandbox(self.dir)

        def _write():
            f = open(os.devnull, 'w')
            f.write('xxx')
            f.close()

        sandbox.run(_write)
Ejemplo n.º 2
0
    def test_devnull(self):
        sandbox = DirectorySandbox(self.dir)

        def _write():
            f = open(os.devnull, 'w')
            f.write('xxx')
            f.close()

        sandbox.run(_write)
Ejemplo n.º 3
0
 def test_win32com(self):
     """
     win32com should not be prevented from caching COM interfaces
     in gen_py.
     """
     import win32com
     gen_py = win32com.__gen_path__
     target = os.path.join(gen_py, 'test_write')
     sandbox = DirectorySandbox(self.dir)
     try:
         try:
             sandbox.run(self._file_writer(target))
         except SandboxViolation:
             self.fail("Could not create gen_py file due to SandboxViolation")
     finally:
         if os.path.exists(target): os.remove(target)
Ejemplo n.º 4
0
 def test_devnull(self):
     if sys.version < '2.4':
         return
     sandbox = DirectorySandbox(self.dir)
     sandbox.run(self._file_writer(os.devnull))