From 2536b3f5f41137ad3ec67bb8a5205cb7bd4bf6d1 Mon Sep 17 00:00:00 2001 From: Rehan Dalal Date: Thu, 29 Jul 2021 22:22:50 -0400 Subject: [PATCH] Cleanup --- tests/test_runner.py | 6 ++++-- therapist/utils/git/status.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_runner.py b/tests/test_runner.py index 04dc03b..d8a8582 100644 --- a/tests/test_runner.py +++ b/tests/test_runner.py @@ -412,8 +412,8 @@ def test_run_process_error(self, project): c = Config(project.path) r = Runner(c.cwd, enable_git=True) result, message = r.run_process(c.actions.get("lint")) - assert result.is_error + assert result.is_error assert len(r.files) == 10000 assert message == ( "#{bright}Linting ............................................................. " @@ -428,8 +428,9 @@ def test_run_process_skips_deleted(self, project): c = Config(project.path) r = Runner(c.cwd, enable_git=True) - r.run_process(c.actions.get("lint")) + result, message = r.run_process(c.actions.get("lint")) + assert result.is_skip assert len(r.files) == 0 def test_action_no_run(self, tmpdir): @@ -639,5 +640,6 @@ def test_skips_staged_file_deleted_in_working_tree_with_include_unstaged(self, p r = Runner(c.cwd, enable_git=True, include_unstaged=True) result, message = r.run_process(c.actions.get("lint")) + assert len(r.files) == 0 assert result.is_skip assert not project.exists("pass.txt") diff --git a/therapist/utils/git/status.py b/therapist/utils/git/status.py index 0115010..1c41201 100644 --- a/therapist/utils/git/status.py +++ b/therapist/utils/git/status.py @@ -3,7 +3,7 @@ class Status(object): def __init__(self, status): - matches = re.search(r"^((?:[MADRCU ?!]){2}) (.+?)(?: -> (.+?))?$", status) + matches = re.search(r"^([MADRCU ?!]{2}) (.+?)(?: -> (.+?))?$", status) self.x = matches[1][0] self.y = matches[1][1] self.path = matches[3] if matches[3] else matches[2]