Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_link_examples(project_dir, tmpdir):
os.chdir(project_dir)
with pytest.raises(exceptions.CruftAlreadyPresent):
verify_and_test_examples(api.link)
tmpdir.chdir()
Repo.clone_from("https://github.com/timothycrosley/cruft", str(tmpdir))
os.remove(os.path.join(tmpdir, ".cruft.json"))
verify_and_test_examples(api.link)
def test_link_examples(project_dir, tmpdir):
os.chdir(project_dir)
with pytest.raises(exceptions.CruftAlreadyPresent):
verify_and_test_examples(api.link)
tmpdir.chdir()
Repo.clone_from("https://github.com/timothycrosley/cruft", str(tmpdir))
os.remove(os.path.join(tmpdir, ".cruft.json"))
verify_and_test_examples(api.link)
def _link_output(linked: bool) -> None:
if linked:
print("")
print("Project successfully linked to template!")
else:
print("")
print("Project linking failed :(")
cli = hug.cli(api=hug_api)
cli(api.create)
cli.output(_update_output)(api.update)
cli.output(_check_command_output)(api.check)
cli.output(_link_output)(api.link)