Exemplo n.º 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')
Exemplo n.º 2
0
 def setUp(self):
     self.test_dir = tempfile.mkdtemp()
     app = taunus.main({}, default_root=self.test_dir)
     self.app = TestApp(app)
Exemplo n.º 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('/')
Exemplo n.º 4
0
 def test_default_root_not_absolute_raises_error(self):
     with self.assertRaises(ValueError):
         app = taunus.main({}, default_root='~')
Exemplo n.º 5
0
 def test_init_with_unexistent_default_root_raises_error(self):
     with self.assertRaises(ValueError):
         app = taunus.main({}, default_root='/non/existing/path/')
Exemplo n.º 6
0
 def test_missing_default_root_raises_error(self):
     with self.assertRaises(KeyError):
         app = taunus.main({})