def test_good_cli_run(tmp_path): run_result = CopierApp.run( ["--quiet", "-a", "altered-answers.yml", str(SIMPLE_DEMO_PATH), str(tmp_path)], exit=False, ) a_txt = tmp_path / "a.txt" assert run_result[1] == 0 assert a_txt.exists() assert a_txt.is_file() assert a_txt.read_text().strip() == "EXAMPLE_CONTENT" answers = yaml.safe_load((tmp_path / "altered-answers.yml").read_text()) assert answers["_src_path"] == str(SIMPLE_DEMO_PATH)
from copier.cli import CopierApp if __name__ == "__main__": CopierApp.run()