Beispiel #1
0
 def test_default_root_is_symlink_raises_error(self):
     os.symlink('/', '/tmp/foo')
     try:
         with self.assertRaises(ValueError):
             app = taunus.main({}, default_root='/tmp/foo')
     finally:
         os.remove('/tmp/foo')
Beispiel #2
0
 def setUp(self):
     self.test_dir = tempfile.mkdtemp()
     app = taunus.main({}, default_root=self.test_dir)
     self.app = TestApp(app)
Beispiel #3
0
 def test_vanished_default_root_raises_error(self):
     test_dir = tempfile.mkdtemp()
     app = TestApp(taunus.main({}, default_root=test_dir))
     shutil.rmtree(test_dir)
     with self.assertRaises(ValueError):
         app.get('/')
Beispiel #4
0
 def test_default_root_not_absolute_raises_error(self):
     with self.assertRaises(ValueError):
         app = taunus.main({}, default_root='~')
Beispiel #5
0
 def test_init_with_unexistent_default_root_raises_error(self):
     with self.assertRaises(ValueError):
         app = taunus.main({}, default_root='/non/existing/path/')
Beispiel #6
0
 def test_missing_default_root_raises_error(self):
     with self.assertRaises(KeyError):
         app = taunus.main({})