def test_project_directory_existence_ok(self): """ Specified directory exists """ valid_instance = ProjectDirectoryExistence() ret = valid_instance(self._pj_dir) assert ret is None
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)
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
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
def __valid_essential_dir(self): """ Project directory validation """ valid_instance = ProjectDirectoryExistence() valid_instance(self._pj_dir)