File tree 1 file changed +5
-3
lines changed 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -27,25 +27,27 @@ def tmp_commitizen_project(tmp_git_project):
27
27
@pytest .fixture (scope = "function" )
28
28
def tmp_commitizen_project_with_gpg (tmp_commitizen_project ):
29
29
_gpg_file = tmp_commitizen_project .join ("gpg_setup" )
30
+ _signer_mail = "joe@foo.bar"
30
31
with open (_gpg_file , "w" , newline = "" ) as f :
31
32
f .write ("Key-Type: default" + os .linesep )
32
33
f .write ("Subkey-Type: default" + os .linesep )
33
34
f .write ("Name-Real: Joe Tester" + os .linesep )
34
35
f .write ("Name-Comment: with stupid passphrase" + os .linesep )
35
- f .write ("Name-Email: joe@foo.bar " + os .linesep )
36
- f .write ("Expire-Date: 0 " + os .linesep )
36
+ f .write (f "Name-Email: { _signer_mail } " + os .linesep )
37
+ f .write ("Expire-Date: 1 " + os .linesep )
37
38
38
39
cmd .run (
39
40
f"gpg --batch --passphrase '' --pinentry-mode loopback --generate-key { _gpg_file } "
40
41
)
41
42
42
- _new_key = cmd .run ("gpg --list-secret-keys joe@foo.bar " )
43
+ _new_key = cmd .run (f "gpg --list-secret-keys { _signer_mail } " )
43
44
_m = re .search (
44
45
rf"[a-zA-Z0-9 \[\]-_]*{ os .linesep } [ ]*([0-9A-Za-z]*){ os .linesep } [{ os .linesep } a-zA-Z0-9 \[\]-_<>@]*" ,
45
46
_new_key .out ,
46
47
)
47
48
if _m :
48
49
_key_id = _m .group (1 )
50
+ print (f"Key { _key_id } found for { _signer_mail } " )
49
51
cmd .run ("git config --global commit.gpgsign true" )
50
52
cmd .run (f"git config --global user.signingkey { _key_id } " )
51
53
You can’t perform that action at this time.
0 commit comments