Skip to content

Commit 48d5486

Browse files
grievejiafacebook-github-bot
authored andcommitted
Remove all _call_client mock in init tests
Reviewed By: shannonzhu Differential Revision: D23762991 fbshipit-source-id: 55f12882ebb9ff31c0976d59da1540026c6d812f
1 parent b0a0af0 commit 48d5486

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

client/commands/tests/initialize_test.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from pathlib import Path
1313
from unittest.mock import call, mock_open, patch
1414

15-
from ... import commands
1615
from ...commands import initialize
1716
from ...commands.initialize import log
1817

@@ -55,9 +54,7 @@ def exists(path):
5554
isfile.side_effect = exists
5655
# One for shutil.which("watchman"), another for shutil.which(BINARY_NAME).
5756
which.side_effect = ["watchman", "binary"]
58-
with patch.object(commands.Command, "_call_client"), patch.object(
59-
initialize, "find_typeshed", return_value=Path("/tmp")
60-
):
57+
with patch.object(initialize, "find_typeshed", return_value=Path("/tmp")):
6158
initialize.Initialize().run()
6259
subprocess_run.assert_has_calls(
6360
[
@@ -78,18 +75,14 @@ def exists(path):
7875
isfile.side_effect = exists
7976
file = mock_open()
8077
with patch("builtins.open", file), patch.object(
81-
commands.Command, "_call_client"
82-
), patch.object(
8378
initialize.Initialize, "_get_local_configuration", return_value={}
84-
), patch.object(
85-
initialize.Initialize, "_is_local", return_value=True
86-
):
79+
), patch.object(initialize.Initialize, "_is_local", return_value=True):
8780
initialize.Initialize().run()
8881
file().write.assert_has_calls([call("{}"), call("\n")])
8982

90-
with patch.object(commands.Command, "_call_client"), patch.object(
91-
sys, "argv", ["/tmp/pyre/bin/pyre"]
92-
), patch.object(initialize, "find_typeshed", return_value=Path("/tmp")):
83+
with patch.object(sys, "argv", ["/tmp/pyre/bin/pyre"]), patch.object(
84+
initialize, "find_typeshed", return_value=Path("/tmp")
85+
):
9386
which.reset_mock()
9487
which.side_effect = [True, None, "/tmp/pyre/bin/pyre.bin"]
9588
initialize.Initialize()._get_configuration()

0 commit comments

Comments
 (0)