From 243df2042ed756e7829cd39d3ebe3d1919444d5d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 21 Mar 2025 23:27:05 -0400 Subject: launcher: change RunResult to subprocess.CompletedProcess Since we require Python 3.6 now in the launcher, swap out our custom RunResult class for the standard subprocess one. Change-Id: Idd8598df37c0a952d3ef828df6e250cab03c6589 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/462341 Reviewed-by: Gavin Mak Tested-by: Mike Frysinger Commit-Queue: Mike Frysinger --- tests/test_wrapper.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/test_wrapper.py') diff --git a/tests/test_wrapper.py b/tests/test_wrapper.py index 8bebdf80..8bb5eb28 100644 --- a/tests/test_wrapper.py +++ b/tests/test_wrapper.py @@ -17,6 +17,7 @@ import io import os import re +import subprocess import sys import tempfile import unittest @@ -358,8 +359,8 @@ class VerifyRev(RepoWrapperTestCase): def test_verify_passes(self): """Check when we have a valid signed tag.""" - desc_result = self.wrapper.RunResult(0, "v1.0\n", "") - gpg_result = self.wrapper.RunResult(0, "", "") + desc_result = subprocess.CompletedProcess([], 0, "v1.0\n", "") + gpg_result = subprocess.CompletedProcess([], 0, "", "") with mock.patch.object( self.wrapper, "run_git", side_effect=(desc_result, gpg_result) ): @@ -370,8 +371,8 @@ class VerifyRev(RepoWrapperTestCase): def test_unsigned_commit(self): """Check we fall back to signed tag when we have an unsigned commit.""" - desc_result = self.wrapper.RunResult(0, "v1.0-10-g1234\n", "") - gpg_result = self.wrapper.RunResult(0, "", "") + desc_result = subprocess.CompletedProcess([], 0, "v1.0-10-g1234\n", "") + gpg_result = subprocess.CompletedProcess([], 0, "", "") with mock.patch.object( self.wrapper, "run_git", side_effect=(desc_result, gpg_result) ): @@ -382,7 +383,7 @@ class VerifyRev(RepoWrapperTestCase): def test_verify_fails(self): """Check we fall back to signed tag when we have an unsigned commit.""" - desc_result = self.wrapper.RunResult(0, "v1.0-10-g1234\n", "") + desc_result = subprocess.CompletedProcess([], 0, "v1.0-10-g1234\n", "") gpg_result = Exception with mock.patch.object( self.wrapper, "run_git", side_effect=(desc_result, gpg_result) -- cgit v1.2.3-54-g00ecf