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