From 20ff60e9f0e8528b00b03e036fa3d41743d53dfa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 21 Jan 2022 20:59:08 +0100 Subject: Adding upstream version 2.17.0. Signed-off-by: Daniel Baumann --- tests/languages/conda_test.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/languages/conda_test.py (limited to 'tests/languages/conda_test.py') diff --git a/tests/languages/conda_test.py b/tests/languages/conda_test.py new file mode 100644 index 0000000..6faa78f --- /dev/null +++ b/tests/languages/conda_test.py @@ -0,0 +1,38 @@ +import pytest + +from pre_commit import envcontext +from pre_commit.languages.conda import _conda_exe + + +@pytest.mark.parametrize( + ('ctx', 'expected'), + ( + pytest.param( + ( + ('PRE_COMMIT_USE_MICROMAMBA', envcontext.UNSET), + ('PRE_COMMIT_USE_MAMBA', envcontext.UNSET), + ), + 'conda', + id='default', + ), + pytest.param( + ( + ('PRE_COMMIT_USE_MICROMAMBA', '1'), + ('PRE_COMMIT_USE_MAMBA', ''), + ), + 'micromamba', + id='default', + ), + pytest.param( + ( + ('PRE_COMMIT_USE_MICROMAMBA', ''), + ('PRE_COMMIT_USE_MAMBA', '1'), + ), + 'mamba', + id='default', + ), + ), +) +def test_conda_exe(ctx, expected): + with envcontext.envcontext(ctx): + assert _conda_exe() == expected -- cgit v1.2.3