summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_sandbox.py
blob: 1b0dc4eabaf0f94067e62f24f5e666b404ac0847 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""develop tests
"""
import sys
import os
import shutil
import unittest
import tempfile

from setuptools.sandbox import DirectorySandbox

class TestSandbox(unittest.TestCase):

    def setUp(self):
        self.dir = tempfile.mkdtemp()

    def tearDown(self):
        shutil.rmtree(self.dir)

    def test_devnull(self):
        sandbox = DirectorySandbox(self.dir)

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

        sandbox.run(_write)