We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentf1060be commitc50416fCopy full SHA for c50416f
tests/cmd/test_git.py
@@ -3,6 +3,7 @@
3
4
importpytest
5
6
+fromlibvcs._internal.subprocessimportSubprocessCommand
7
fromlibvcs.cmdimportgit
8
9
@@ -11,3 +12,20 @@ def test_run(dir_type: Callable, tmp_path: pathlib.Path):
11
12
repo=git.Git(dir=dir_type(tmp_path))
13
14
assertrepo.dir==tmp_path
15
+
16
17
+@pytest.mark.parametrize("dir_type", [str,pathlib.Path])
18
+deftest_run_deferred(dir_type:Callable,tmp_path:pathlib.Path):
19
+classGitDeferred(git.Git):
20
+defrun(self,args,**kwargs):
21
+returnSubprocessCommand(["git",*args],**kwargs)
22
23
+g=GitDeferred(dir=dir_type(tmp_path))
24
+cmd=g.run(["help"])
25
26
+assertg.dir==tmp_path
27
+assertcmd.args== ["git","help"]
28
29
+assertcmd.run(capture_output=True,text=True).stdout.startswith(
30
+"usage: git [--version] [--help] [-C <path>]"
31
+ )