Example #1
0
 def test_symlink_outside_tree(self):
     os.symlink('../foo', self._abspath('outside'))
     with self.assertRaises(AssertionError):
         filemod_db._resolve_symlinks('outside')
Example #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')
Example #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')
Example #4
0
 def test_absolute_symlink(self):
     os.symlink('/etc/issue', self._abspath('abs'))
     with self.assertRaises(AssertionError):
         filemod_db._resolve_symlinks('abs')
Example #5
0
 def test_symlink_loop(self):
     os.symlink('loop', self._abspath('loop'))
     with self.assertRaises(OSError):
         filemod_db._resolve_symlinks('loop')
Example #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')))
Example #7
0
 def test_not_a_symlinks(self):
     self.assertEqual('i1', filemod_db._resolve_symlinks('i1'))