Esempio n. 1
0
 def setUp(self):
     self.tempdir = tempfile.mkdtemp(dir=HOME)
     self.subtempdir = tempfile.mkdtemp(
         dir=os.path.join(HOME, self.tempdir))
     self.tempfile = touch(os.path.join(self.tempdir, TESTFN))
     self.subtempfile = touch(os.path.join(self.subtempdir, TESTFN))
     warnings.filterwarnings("error")
Esempio n. 2
0
 def setUp(self):
     self.tempdir = tempfile.mkdtemp(dir=HOME)
     self.subtempdir = tempfile.mkdtemp(
         dir=os.path.join(HOME, self.tempdir))
     self.tempfile = touch(os.path.join(self.tempdir, TESTFN))
     self.subtempfile = touch(os.path.join(self.subtempdir, TESTFN))
     warnings.filterwarnings("error")
Esempio n. 3
0
 def test_validpath_validlink(self):
     # Test validpath by issuing a symlink pointing to a path
     # inside the root directory.
     testfn = self.get_testfn()
     testfn2 = self.get_testfn()
     fs = AbstractedFS(u('/'), None)
     fs._root = HOME
     touch(testfn)
     os.symlink(testfn, testfn2)
     self.assertTrue(fs.validpath(u(testfn)))
Esempio n. 4
0
 def setUp(self):
     self.tempdir = os.path.abspath(self.get_testfn())
     self.subtempdir = os.path.join(self.tempdir, self.get_testfn())
     self.tempfile = os.path.join(self.tempdir, self.get_testfn())
     self.subtempfile = os.path.join(self.subtempdir, self.get_testfn())
     os.mkdir(self.tempdir)
     os.mkdir(self.subtempdir)
     touch(self.tempfile)
     touch(self.subtempfile)
     warnings.filterwarnings("error")
Esempio n. 5
0
 def test_validpath_validlink(self):
     # Test validpath by issuing a symlink pointing to a path
     # inside the root directory.
     fs = AbstractedFS(u('/'), None)
     fs._root = HOME
     TESTFN2 = TESTFN + '1'
     try:
         touch(TESTFN)
         os.symlink(TESTFN, TESTFN2)
         self.assertTrue(fs.validpath(u(TESTFN)))
     finally:
         safe_remove(TESTFN, TESTFN2)
Esempio n. 6
0
 def test_validpath_validlink(self):
     # Test validpath by issuing a symlink pointing to a path
     # inside the root directory.
     fs = AbstractedFS(u('/'), None)
     fs._root = HOME
     TESTFN2 = TESTFN + '1'
     try:
         touch(TESTFN)
         os.symlink(TESTFN, TESTFN2)
         self.assertTrue(fs.validpath(u(TESTFN)))
     finally:
         safe_remove(TESTFN, TESTFN2)