Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit85ef145

Browse files
committed
Extend test_cmd_override to test exception'scommand attribute
1 parentdb6fb90 commit85ef145

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎test/test_git.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,17 +321,17 @@ def test_version(self):
321321
self.assertIsInstance(n,int)
322322
# END verify number types
323323

324-
deftest_cmd_override(self):
325-
withmock.patch.object(
326-
type(self.git),
327-
"GIT_PYTHON_GIT_EXECUTABLE",
328-
osp.join("some","path","which","doesn't","exist","gitbinary"),
329-
):
330-
self.assertRaises(GitCommandNotFound,self.git.version)
331-
332324
deftest_git_exc_name_is_git(self):
333325
self.assertEqual(self.git.git_exec_name,"git")
334326

327+
deftest_cmd_override(self):
328+
"""Directly set bad GIT_PYTHON_GIT_EXECUTABLE causes git operations to raise."""
329+
bad_path=osp.join("some","path","which","doesn't","exist","gitbinary")
330+
withmock.patch.object(type(self.git),"GIT_PYTHON_GIT_EXECUTABLE",bad_path):
331+
withself.assertRaises(GitCommandNotFound)asctx:
332+
self.git.version()
333+
self.assertEqual(ctx.exception.command, [bad_path,"version"])
334+
335335
@ddt.data(("0",), ("q",), ("quiet",), ("s",), ("silence",), ("silent",), ("n",), ("none",))
336336
deftest_initial_refresh_from_bad_git_path_env_quiet(self,case):
337337
"""In "q" mode, bad initial path sets "git" and is quiet."""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp