@@ -72,7 +72,7 @@ def test_grants( tmp_path ):
7272 product = "Self Signed" ,
7373 keypair = keyp_ss .into_keypair ( username = user_ss , password = pswd_ss ),
7474 )
75- log .warning ( f"Author: { author } " )
75+ log .info ( f"Author: { author } " )
7676
7777 # Now create the License suitable for self-signing; no client (so any client can sign it)
7878 lic = licensing .license (
@@ -81,7 +81,7 @@ def test_grants( tmp_path ):
8181 grant = {'self-signed' : { 'some-capability' : 10 }},
8282 confirm = False , # Not a real domain...
8383 )
84- log .warning ( f"Self-Signable License: { lic } " )
84+ log .info ( f"Self-Signable License: { lic } " )
8585
8686 # We've got a self-signed.crypto-license, signed by the Vendor, with no specific Client
8787 # specified. It's good for anyone to use. Lets make a link to it, under the name that our
@@ -107,14 +107,14 @@ def test_grants( tmp_path ):
107107 ls = subprocess .run (
108108 [ 'ls' , '-l' , str ( here ) ], stdout = subprocess .PIPE ,
109109 )
110- log .warning ( f"Test directory:\n { ls .stdout .decode ( 'UTF-8' )} \n \n " )
110+ log .info ( f"Test directory:\n { ls .stdout .decode ( 'UTF-8' )} \n \n " )
111111
112112 client = licensing .Agent (
113113 name = "Perry Kundert" ,
114114 service = "client-user" ,
115115 pubkey = keyp_cl ['vk' ],
116116 )
117- log .warning ( f"Client: { client } " )
117+ log .info ( f"Client: { client } " )
118118
119119 # We'll be loading an existing Client Agent keypair, so restrict it from registering a new one.
120120 # It must try to load the Author's License (using the author.service as the basename), and then
@@ -131,21 +131,31 @@ def test_grants( tmp_path ):
131131
132132 username = user_cl
133133 password = pswd_cl
134+ grants = None
134135 try :
135136 key ,val = next ( reloader )
136137 while True :
137- log .warning ( f"test_grants <-- { key } : { val } " )
138+ log .info ( f"test_grants <-- { key } : { val } " )
138139 if key == Process .PROMPT :
139140 if 'username' in val :
140- log .warning ( f"test_grants --> { username } " )
141+ log .info ( f"test_grants --> { username } " )
141142 key ,val = reloader .send ( username )
142143 continue
143144 elif 'password' in val :
144- log .warning ( f"test_grants --> { password } " )
145+ log .info ( f"test_grants --> { password } " )
145146 key ,val = reloader .send ( password )
146147 continue
147148 else :
148- log .warning ( f"test_grants -x- ignoring { val } " )
149+ log .info ( f"test_grants -x- ignoring { val } " )
150+ elif key == Process .GRANTS :
151+ grants = val
149152 key ,val = next ( reloader )
150153 except StopIteration :
151- log .warning ( f"test_grants xxx Done w/ key == { key } , val == { val } " )
154+ log .info ( f"test_grants xxx Done w/ key == { key } , val == { val } " )
155+
156+ assert str ( grants ) == """\
157+ {
158+ "self-signed":{
159+ "some-capability":10
160+ }
161+ }"""
0 commit comments