From 0e84ac6e218a79e0ef4551b07a2d4c21d3410f83 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 5 Nov 2018 10:43:45 +0100 Subject: [PATCH] TT#44969 Provide test cases for `git status --porcelain` mode Change-Id: Iaf167a9a8ad12d36a9b9ebe8250c2b91a56ff239 --- t/test_git.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/t/test_git.py b/t/test_git.py index fd1341e7..e6b6a114 100644 --- a/t/test_git.py +++ b/t/test_git.py @@ -47,3 +47,18 @@ def test_status_output(cli, gitrepo): # before it was "working directory" regex = re.compile(r"nothing to commit, working (tree|directory)") assert re.search(regex, out) + + ex, out, error = git.status('--porcelain=v2') + assert out == "" + assert error == "" + assert ex == 0 + + # create new file + newfile = os.path.join(git.root, 'newfile') + with open(newfile, 'w') as fd: + fd.write('#!/bin/sh\necho "Hello World"\n') + + ex, out, error = git.status('--porcelain=v2') + assert out == '''? newfile\n''' + assert error == "" + assert ex == 0