summaryrefslogtreecommitdiffstats
path: root/tests/test_info.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_info.py')
-rw-r--r--tests/test_info.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_info.py b/tests/test_info.py
new file mode 100644
index 0000000..025aedc
--- /dev/null
+++ b/tests/test_info.py
@@ -0,0 +1,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