summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-18 10:49:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-18 10:49:23 +0000
commita2a738495ed1b8602c67efc28827d993b1b47150 (patch)
tree67a4ab28374c2489f5cd30dbed4242ea80f0ee77 /tests
parentReleasing progress-linux version 0.16.5-1. (diff)
downloadgita-a2a738495ed1b8602c67efc28827d993b1b47150.tar.xz
gita-a2a738495ed1b8602c67efc28827d993b1b47150.zip
Merging upstream version 0.16.6.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_main.py19
-rw-r--r--tests/test_utils.py6
2 files changed, 14 insertions, 11 deletions
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",
),
],
)