Skip to content

Commit 7b2e40e

Browse files
committed
test(vcs/git): init switch args
1 parent ee82ddc commit 7b2e40e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/unit/test_vcs.py

+29
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,35 @@ def test_fetch_new_quiet(self) -> None:
926926

927927
update_submodules_mock.assert_called_with(self.dest, verbosity=0)
928928

929+
def test_switch(self) -> None:
930+
with mock.patch.object(self.svn, "update_submodules") as update_submodules_mock:
931+
self.svn.switch(
932+
self.dest, hide_url(self.url), self.rev_options, verbosity=1
933+
)
934+
935+
assert self.call_subprocess_mock.call_args_list[1][0][0] == [
936+
"git",
937+
"checkout",
938+
"HEAD",
939+
]
940+
941+
update_submodules_mock.assert_called_with(self.dest, verbosity=1)
942+
943+
def test_switch_quiet(self) -> None:
944+
with mock.patch.object(self.svn, "update_submodules") as update_submodules_mock:
945+
self.svn.switch(
946+
self.dest, hide_url(self.url), self.rev_options, verbosity=0
947+
)
948+
949+
assert self.call_subprocess_mock.call_args_list[1][0][0] == [
950+
"git",
951+
"checkout",
952+
"-q",
953+
"HEAD",
954+
]
955+
956+
update_submodules_mock.assert_called_with(self.dest, verbosity=0)
957+
929958
def test_update(self) -> None:
930959
with mock.patch.object(self.svn, "get_git_version", return_value=(1, 9)):
931960
with mock.patch.object(

0 commit comments

Comments
 (0)