From a2a738495ed1b8602c67efc28827d993b1b47150 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 18 Jul 2023 12:49:23 +0200 Subject: Merging upstream version 0.16.6.1. Signed-off-by: Daniel Baumann --- tests/test_main.py | 19 +++++++++++-------- tests/test_utils.py | 6 +++--- 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/test_main.py b/tests/test_main.py index 6d05867..a877160 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -130,18 +130,21 @@ class TestLsLl: [ ( PATH_FNAME, - "repo1 cmaster [dsu] \x1b[0m msg \nrepo2 cmaster [dsu] \x1b[0m msg \nxxx cmaster [dsu] \x1b[0m msg \n", + "repo1 \x1b[31mmaster [*+?⇕] \x1b[0m msg \nrepo2 \x1b[31mmaster [*+?⇕] \x1b[0m msg \nxxx \x1b[31mmaster [*+?⇕] \x1b[0m msg \n", ), (PATH_FNAME_EMPTY, ""), ( PATH_FNAME_CLASH, - "repo1 cmaster [dsu] \x1b[0m msg \nrepo2 cmaster [dsu] \x1b[0m msg \n", + "repo1 \x1b[31mmaster [*+?⇕] \x1b[0m msg \nrepo2 \x1b[31mmaster [*+?⇕] \x1b[0m msg \n", ), ], ) @patch("gita.utils.is_git", return_value=True) @patch("gita.info.get_head", return_value="master") - @patch("gita.info._get_repo_status", return_value=("d", "s", "u", "c")) + @patch( + "gita.info._get_repo_status", + return_value=("dirty", "staged", "untracked", "diverged"), + ) @patch("gita.info.get_commit_msg", return_value="msg") @patch("gita.info.get_commit_time", return_value="") @patch("gita.common.get_config_fname") @@ -566,7 +569,7 @@ def test_set_color(mock_get_fname, tmpdir): args = argparse.Namespace() args.color_cmd = "set" args.color = "b_white" - args.situation = "no-remote" + args.situation = "no_remote" with tmpdir.as_cwd(): csv_config = Path.cwd() / "colors.csv" mock_get_fname.return_value = csv_config @@ -576,11 +579,11 @@ def test_set_color(mock_get_fname, tmpdir): items = info.get_color_encoding() info.get_color_encoding.cache_clear() # avoid side effect assert items == { - "no-remote": "b_white", - "in-sync": "green", + "no_remote": "b_white", + "in_sync": "green", "diverged": "red", - "local-ahead": "purple", - "remote-ahead": "yellow", + "local_ahead": "purple", + "remote_ahead": "yellow", } diff --git a/tests/test_utils.py b/tests/test_utils.py index 1e4f125..2936f0e 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -115,17 +115,17 @@ def test_auto_group(repos, paths, expected): ( [{"abc": {"path": "/root/repo/", "type": "", "flags": []}}, False], True, - "abc \x1b[31mrepo [*+?] \x1b[0m msg xx", + "abc \x1b[31mrepo [*+?⇕] \x1b[0m msg xx", ), ( [{"abc": {"path": "/root/repo/", "type": "", "flags": []}}, True], True, - "abc repo [*+?] msg xx", + "abc repo [*+?⇕] msg xx", ), ( [{"repo": {"path": "/root/repo2/", "type": "", "flags": []}}, False], False, - "repo \x1b[32mrepo [?] \x1b[0m msg xx", + "repo \x1b[32mrepo [?] \x1b[0m msg xx", ), ], ) -- cgit v1.2.3