summaryrefslogtreecommitdiffstats
path: root/tests/test_info.py
blob: c234d78fa729564c49c26f63b79471b41eb9ed25 (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(['--flags'], ['my', 'args'])
    mock_run.assert_called_once_with(
        ['git', '--flags', 'diff', '--quiet', 'my', 'args'],
        stderr=subprocess.DEVNULL,
    )
    assert got == mock_return.returncode