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