17
17
import io
18
18
import os
19
19
import re
20
+ import subprocess
20
21
import sys
21
22
import tempfile
22
23
import unittest
@@ -358,8 +359,8 @@ class VerifyRev(RepoWrapperTestCase):
358
359
359
360
def test_verify_passes (self ):
360
361
"""Check when we have a valid signed tag."""
361
- desc_result = self . wrapper . RunResult ( 0 , "v1.0\n " , "" )
362
- gpg_result = self . wrapper . RunResult ( 0 , "" , "" )
362
+ desc_result = subprocess . CompletedProcess ([], 0 , "v1.0\n " , "" )
363
+ gpg_result = subprocess . CompletedProcess ([], 0 , "" , "" )
363
364
with mock .patch .object (
364
365
self .wrapper , "run_git" , side_effect = (desc_result , gpg_result )
365
366
):
@@ -370,8 +371,8 @@ def test_verify_passes(self):
370
371
371
372
def test_unsigned_commit (self ):
372
373
"""Check we fall back to signed tag when we have an unsigned commit."""
373
- desc_result = self . wrapper . RunResult ( 0 , "v1.0-10-g1234\n " , "" )
374
- gpg_result = self . wrapper . RunResult ( 0 , "" , "" )
374
+ desc_result = subprocess . CompletedProcess ([], 0 , "v1.0-10-g1234\n " , "" )
375
+ gpg_result = subprocess . CompletedProcess ([], 0 , "" , "" )
375
376
with mock .patch .object (
376
377
self .wrapper , "run_git" , side_effect = (desc_result , gpg_result )
377
378
):
@@ -382,7 +383,7 @@ def test_unsigned_commit(self):
382
383
383
384
def test_verify_fails (self ):
384
385
"""Check we fall back to signed tag when we have an unsigned commit."""
385
- desc_result = self . wrapper . RunResult ( 0 , "v1.0-10-g1234\n " , "" )
386
+ desc_result = subprocess . CompletedProcess ([], 0 , "v1.0-10-g1234\n " , "" )
386
387
gpg_result = Exception
387
388
with mock .patch .object (
388
389
self .wrapper , "run_git" , side_effect = (desc_result , gpg_result )
0 commit comments