def test_verify_no_default_sections_left(integration, capsys, file_input, section): """ Given - Read me that contains sections that are created as default and need to be changed When - Run validate on README file Then - Ensure no default sections in the readme file """ integration.readme.write(file_input) readme_path = integration.readme.path readme_validator = ReadMeValidator(readme_path) result = readme_validator.verify_no_default_sections_left() stdout, _ = capsys.readouterr() section_error = f'Replace "{section}" with a suitable info.' assert not result assert section_error in stdout
def test_readme_ignore(integration, readme_fake_path, readme_text): """ Check that packs in ignore list are ignored. Given - README path of ignore pack When - Run validate on README of ignored pack Then - Ensure validation ignored the pack """ integration.readme.write(readme_text) readme_path = integration.readme.path readme_validator = ReadMeValidator(readme_path) # change the pack path to readme_fake_path from pathlib import Path readme_validator.file_path = Path(readme_fake_path) readme_validator.pack_path = readme_validator.file_path.parent result = readme_validator.verify_no_default_sections_left() assert result