示例#1
0
 def test_project_directory_existence_ok(self):
     """
     Specified directory exists
     """
     valid_instance = ProjectDirectoryExistence()
     ret = valid_instance(self._pj_dir)
     assert ret is None
示例#2
0
 def test_project_directory_existence_ng(self):
     """
     Specified directory does not exist
     """
     shutil.rmtree(self._pj_dir)
     with pytest.raises(DirStructureInvalid) as excinfo:
         valid_instance = ProjectDirectoryExistence()
         valid_instance(self._pj_dir)
     assert "Project directory %s does not exist" % self._pj_dir in str(
         excinfo.value)
示例#3
0
 def test_project_directory_existence_ng(self):
     """
     Specified directory does not exist
     """
     valid_instance = ProjectDirectoryExistence()
     exists_pj_dir = True
     try:
         valid_instance(self._pj_dir)
     except Exception:
         exists_pj_dir = False
     assert exists_pj_dir is False
示例#4
0
 def test_project_directory_existence_ok(self):
     """
     Specified directory exists
     """
     os.makedirs(self._pj_dir)
     valid_instance = ProjectDirectoryExistence()
     exists_pj_dir = True
     try:
         valid_instance(self._pj_dir)
     except Exception:
         exists_pj_dir = False
     finally:
         shutil.rmtree(self._pj_dir)
     assert exists_pj_dir is True
示例#5
0
文件: manager.py 项目: guchey/cliboa
 def __valid_essential_dir(self):
     """
     Project directory validation
     """
     valid_instance = ProjectDirectoryExistence()
     valid_instance(self._pj_dir)