blob: 025aedcae332e822efa35c355859eb7f673fa60d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
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
|