Skip to content

Commit 94a3510

Browse files
committed
refactor(iest/commands/commit): use black
1 parent 0ed35b3 commit 94a3510

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/commands/test_commit_command.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -209,44 +209,42 @@ def test_commit_from_pre_commit_msg_hook(config, mocker, capsys):
209209
assert "Commit message is successful!" in out
210210
commit_mock.assert_not_called()
211211

212+
212213
def test_WrapStdx(mocker):
213214
mocker.patch("os.open")
214215
reader_mock = mocker.mock_open(read_data="data")
215216
mocker.patch("builtins.open", reader_mock, create=True)
216217

217-
stdin_mock_fileno=mocker.patch.object(sys.stdin, 'fileno')
218+
stdin_mock_fileno = mocker.patch.object(sys.stdin, "fileno")
218219
stdin_mock_fileno.return_value = 0
219220
wrap_stdin = commands.commit.WrapStdx(sys.stdin)
220221

221222
assert wrap_stdin.encoding == "UTF-8"
222223
assert wrap_stdin.read() == "data"
223224

224-
225225
writer_mock = mocker.mock_open(read_data="data")
226226
mocker.patch("builtins.open", writer_mock, create=True)
227-
stdout_mock_fileno=mocker.patch.object(sys.stdout, 'fileno')
227+
stdout_mock_fileno = mocker.patch.object(sys.stdout, "fileno")
228228
stdout_mock_fileno.return_value = 1
229229
wrap_stout = commands.commit.WrapStdx(sys.stdout)
230230
wrap_stout.write("data")
231231

232-
if sys.platform == 'linux':
233-
writer_mock.assert_called_once_with("/dev/tty", 'w')
232+
if sys.platform == "linux":
233+
writer_mock.assert_called_once_with("/dev/tty", "w")
234234
else:
235235
pass
236236
writer_mock().write.assert_called_once_with("data")
237237

238-
239238
writer_mock = mocker.mock_open(read_data="data")
240239
mocker.patch("builtins.open", writer_mock, create=True)
241-
stderr_mock_fileno=mocker.patch.object(sys.stdout, 'fileno')
240+
stderr_mock_fileno = mocker.patch.object(sys.stdout, "fileno")
242241
stderr_mock_fileno.return_value = 2
243242
wrap_sterr = commands.commit.WrapStdx(sys.stderr)
244243

245-
246244
wrap_sterr.write("data")
247245

248-
if sys.platform == 'linux':
249-
writer_mock.assert_called_once_with("/dev/tty", 'w')
246+
if sys.platform == "linux":
247+
writer_mock.assert_called_once_with("/dev/tty", "w")
250248
else:
251249
pass
252250
writer_mock().write.assert_called_once_with("data")

0 commit comments

Comments
 (0)