How to use the cruft.exceptions function in cruft

To help you get started, we’ve selected a few cruft examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github timothycrosley / cruft / tests / test_exceptions.py View on Github external
def test_invalid_cookiecutter_repository():
    assert isinstance(exceptions.InvalidCookiecutterRepository(), exceptions.CruftError)
github timothycrosley / cruft / tests / test_exceptions.py View on Github external
def test_unable_to_find_cookiecutter_template_path():
    instance = exceptions.UnableToFindCookiecutterTemplate(Path("."))
    assert instance.directory == "."
    assert isinstance(instance, exceptions.CruftError)
github timothycrosley / cruft / tests / test_api.py View on Github external
def test_create_auto_invalid_repo(test_case, tmpdir):
    tmpdir.chdir()
    with pytest.raises(exceptions.InvalidCookiecutterRepository):
        test_case()
github timothycrosley / cruft / tests / test_api.py View on Github external
def test_check_examples(project_dir):
    with pytest.raises(exceptions.NoCruftFound):
        verify_and_test_examples(api.check)

    os.chdir(project_dir)
    verify_and_test_examples(api.check)