1
0
Fork 0
gita/tests/test_info.py
Daniel Baumann a9c588f707
Adding upstream version 0.10.9.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-02-11 18:25:06 +01:00

16 lines
432 B
Python

import subprocess
from unittest.mock import patch, MagicMock
from gita import info
@patch('subprocess.run')
def test_run_quiet_diff(mock_run):
mock_return = MagicMock()
mock_run.return_value = mock_return
got = info.run_quiet_diff(['my', 'args'])
mock_run.assert_called_once_with(
['git', 'diff', '--quiet', 'my', 'args'],
stderr=subprocess.DEVNULL,
)
assert got == mock_return.returncode