mirror of
https://github.com/copier-org/copier.git
synced 2025-05-05 15:32:54 +00:00
* Refactor * Fix #110. * Rewrite test_config_exclude, test_config_exclude_overridden and test_config_include. These tests were badly designed, using a monkeypatch that would never happen in the real world, and actually producing false positives. I moved them to test_exclude.py and rewritten to test the what and not the how. * Fix #214 by removing skip option. Relevant tests use the better skip_if_exists=["**"]. * Remove subdirectory flag from API/CLI. It was confusing and could lead to bad maintenance situations. Fixes #315. * Remove extra_paths and fix #321 * Remember that you cannot use _copier_conf.src_path as a path now * use dataclasses * Create errors module, simplify some tests, fix many others * Fix some tests, complete EnvOps removal * Fix #214 and some tests related to it * Reorder code * Update docs and imports * Modularize test_complex_questions * Interlink worker and questionary a bit better * Removal of Questionary class, which only had 1 meaningful method that is now merged into Worker to avoid circular dependencies. * Fix #280 in a simple way: only user answers are type-casted inside API, and CLI transforms all `--data` using YAML always. Predictable. * Use prereleases correctly. * Reorder AnswersMap to have a more significative repr. * Simpler cache for old `Question.get_choices()` method (renamed now). * fix wrong test * Fix test_subdirectory * Fix test_tasks (and remove tests/demo_tasks) * Fix path filter tests, and move it to test_exclude, where it belongs * Make test_config pass * Fix more wrongly designed tests * Use cached_property backport if needed * xfail test known to fail on mac * force posix paths on windows * Add typing_extensions for python < 3.8 * Sort dependencies in pyproject.toml * Support python 3.6 str-to-datetime conversion * Workaround https://bugs.python.org/issue43095 * xfail test_path_filter on windows * Upgrade mkdocs and other dependencies to fix https://github.com/pawamoy/mkdocstrings/issues/222 * Add missing reference docs. * Add workaround for https://github.com/pawamoy/mkdocstrings/pull/209 * Docs. * Remove validators module * Add workaround for https://github.com/pawamoy/mkdocstrings/issues/225 * Restore docs autorefs as explained in https://github.com/pawamoy/mkdocstrings/issues/226#issuecomment-775413562. * Workaround https://github.com/pawamoy/pytkdocs/issues/86
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
import re
|
|
|
|
from .helpers import render
|
|
|
|
|
|
def test_output(capsys, tmp_path):
|
|
render(tmp_path, quiet=False)
|
|
_, err = capsys.readouterr()
|
|
assert re.search(r"create[^\s]* config\.py", err)
|
|
assert re.search(r"create[^\s]* pyproject\.toml", err)
|
|
assert re.search(r"create[^\s]* doc[/\\]images[/\\]nslogo\.gif", err)
|
|
|
|
|
|
def test_output_pretend(capsys, tmp_path):
|
|
render(tmp_path, quiet=False, pretend=True)
|
|
_, err = capsys.readouterr()
|
|
assert re.search(r"create[^\s]* config\.py", err)
|
|
assert re.search(r"create[^\s]* pyproject\.toml", err)
|
|
assert re.search(r"create[^\s]* doc[/\\]images[/\\]nslogo\.gif", err)
|
|
|
|
|
|
def test_output_force(capsys, tmp_path):
|
|
render(tmp_path)
|
|
capsys.readouterr()
|
|
render(tmp_path, quiet=False, force=True)
|
|
_, err = capsys.readouterr()
|
|
assert re.search(r"conflict[^\s]* config\.py", err)
|
|
assert re.search(r"force[^\s]* config\.py", err)
|
|
assert re.search(r"identical[^\s]* pyproject\.toml", err)
|
|
assert re.search(r"identical[^\s]* doc[/\\]images[/\\]nslogo\.gif", err)
|
|
|
|
|
|
def test_output_skip(capsys, tmp_path):
|
|
render(tmp_path)
|
|
capsys.readouterr()
|
|
render(tmp_path, quiet=False, skip_if_exists=["config.py"])
|
|
_, err = capsys.readouterr()
|
|
assert re.search(r"conflict[^\s]* config\.py", err)
|
|
assert re.search(r"skip[^\s]* config\.py", err)
|
|
assert re.search(r"identical[^\s]* pyproject\.toml", err)
|
|
assert re.search(r"identical[^\s]* doc[/\\]images[/\\]nslogo\.gif", err)
|
|
|
|
|
|
def test_output_quiet(capsys, tmp_path):
|
|
render(tmp_path, quiet=True)
|
|
out, err = capsys.readouterr()
|
|
assert out == ""
|
|
assert err == ""
|