Exemplo n.º 1
0
 def test_symlink_outside_tree(self):
     os.symlink('../foo', self._abspath('outside'))
     with self.assertRaises(AssertionError):
         filemod_db._resolve_symlinks('outside')
Exemplo n.º 2
0
 def test_symlink_outside_tree_in_directory_component(self):
     os.symlink('../foo', self._abspath('outside_dir'))
     with self.assertRaises(AssertionError):
         filemod_db._resolve_symlinks('outside_dir/bar')
Exemplo n.º 3
0
 def test_absolute_symlink_in_directory_component(self):
     os.symlink('/etc', self._abspath('absdir'))
     with self.assertRaises(AssertionError):
         filemod_db._resolve_symlinks('absdir/issue')
Exemplo n.º 4
0
 def test_absolute_symlink(self):
     os.symlink('/etc/issue', self._abspath('abs'))
     with self.assertRaises(AssertionError):
         filemod_db._resolve_symlinks('abs')
Exemplo n.º 5
0
 def test_symlink_loop(self):
     os.symlink('loop', self._abspath('loop'))
     with self.assertRaises(OSError):
         filemod_db._resolve_symlinks('loop')
Exemplo n.º 6
0
 def test_symlink_in_a_directory_component(self):
     self.assertEqual(
         os.path.join('third_party', 'werkzeug-src', 'werkzeug', 'foo.js'),
         filemod_db._resolve_symlinks(
             os.path.join('third_party', 'werkzeug', 'foo.js')))
Exemplo n.º 7
0
 def test_not_a_symlinks(self):
     self.assertEqual('i1', filemod_db._resolve_symlinks('i1'))