Exemple #1
0
 def test_if_base_is_not_absolute(self):
     with self.assertRaisesRegexp(ValueError, 'is not an absolute path'):
         safe_join('assets', 'js/script.js')
Exemple #2
0
 def test_success(self):
     path = safe_join('/assets', 'js/script.js')
     self.assertEqual(path, '/assets/js/script.js')
Exemple #3
0
 def test_if_path_is_outside_of_base(self):
     with self.assertRaisesRegexp(ValueError, 'is outside of'):
         safe_join('/assets', '../js/script.js')
Exemple #4
0
 def test_if_base_is_not_absolute(self):
     with self.assertRaisesRegexp(ValueError, 'is not an absolute path'):
         safe_join('assets', 'js/script.js')
Exemple #5
0
 def test_success(self):
     path = safe_join('/assets', 'js/script.js')
     self.assertEqual(path, '/assets/js/script.js')
Exemple #6
0
 def test_if_path_is_outside_of_base(self):
     with self.assertRaisesRegexp(ValueError, 'is outside of'):
         safe_join('/assets', '../js/script.js')