Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@auto_pytest(api.create)
def test_create_auto_invalid_repo(test_case, tmpdir):
tmpdir.chdir()
with pytest.raises(exceptions.InvalidCookiecutterRepository):
test_case()
def test_invalid_cookiecutter_repository():
assert isinstance(exceptions.InvalidCookiecutterRepository(), exceptions.CruftError)
def test_unable_to_find_cookiecutter_template_path():
instance = exceptions.UnableToFindCookiecutterTemplate(Path("."))
assert instance.directory == "."
assert isinstance(instance, exceptions.CruftError)
def test_create_auto_invalid_repo(test_case, tmpdir):
tmpdir.chdir()
with pytest.raises(exceptions.InvalidCookiecutterRepository):
test_case()
def test_no_cruft():
instance = exceptions.NoCruftFound(".")
assert instance.directory == "."
assert isinstance(instance, exceptions.CruftError)
def test_update_examples(project_dir, tmpdir):
tmpdir.chdir()
with pytest.raises(exceptions.NoCruftFound):
verify_and_test_examples(api.update)
os.chdir(project_dir)
verify_and_test_examples(api.update)
def test_unable_to_find_cookiecutter_template():
instance = exceptions.UnableToFindCookiecutterTemplate(".")
assert instance.directory == "."
assert isinstance(instance, exceptions.CruftError)
def test_unable_to_find_cookiecutter_template_path():
instance = exceptions.UnableToFindCookiecutterTemplate(Path("."))
assert instance.directory == "."
assert isinstance(instance, exceptions.CruftError)
def test_update_examples(project_dir, tmpdir):
tmpdir.chdir()
with pytest.raises(exceptions.NoCruftFound):
verify_and_test_examples(api.update)
os.chdir(project_dir)
verify_and_test_examples(api.update)
def test_create_examples(tmpdir):
tmpdir.chdir()
verify_and_test_examples(api.create)