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