@@ -98,6 +98,7 @@ def init_syn(self, syn: Synapse) -> None:
9898 def setup_method (self ) -> None :
9999 self .username = "username"
100100 self .auth_token = "auth_token"
101+ self .owner_id = 1234567890
101102 self .user_login_args = UserLoginArgs (
102103 self .username ,
103104 self .auth_token ,
@@ -149,6 +150,7 @@ def test_create_synapse_credential_username_is_None_auth_provided(
149150 mock_init_auth_creds .return_value = mock_creds
150151 mock_creds .secret = self .auth_token
151152 mock_creds .username = self .username
153+ mock_creds .owner_id = self .owner_id
152154 mock_rest_get .return_value = {"userName" : self .username }
153155 creds = self .provider ._create_synapse_credential (
154156 syn = self .syn , username = None , auth_token = self .auth_token
@@ -175,14 +177,15 @@ def test_create_synapse_credential_username_not_None_auth_token_is_not_None(
175177 assert creds is mock_creds
176178
177179 @pytest .mark .parametrize (
178- "login_username,profile_username,profile_emails,profile_displayname" ,
180+ "login_username,profile_username,profile_emails,profile_displayname,profile_owner_id " ,
179181 (
180- ("foo" , "foo" , ["foo@bar.com" ], "foo" ), # username matches
182+ ("foo" , "foo" , ["foo@bar.com" ], "foo" , 123 ), # username matches
181183 (
182184 "foo@bar.com" ,
183185 "foo" ,
184186 ["1@2.com" , "foo@bar.com" , "3@4.com" ],
185187 "foo" ,
188+ 456 ,
186189 ), # email matches
187190 ),
188191 )
@@ -193,6 +196,7 @@ def test_create_synapse_credential__username_auth_token_match(
193196 profile_username ,
194197 profile_emails ,
195198 profile_displayname ,
199+ profile_owner_id ,
196200 ) -> None :
197201 """Verify that if both a username/email and a auth token are provided, the login is successful
198202 if the token matches either the username or a profile email address."""
@@ -202,6 +206,7 @@ def test_create_synapse_credential__username_auth_token_match(
202206 "userName" : profile_username ,
203207 "emails" : profile_emails ,
204208 "displayName" : profile_displayname ,
209+ "ownerId" : profile_owner_id ,
205210 }
206211
207212 cred = self .provider ._create_synapse_credential (
@@ -210,6 +215,7 @@ def test_create_synapse_credential__username_auth_token_match(
210215 assert cred .secret == self .auth_token
211216 assert cred .username == profile_username
212217 assert cred .displayname == profile_displayname
218+ assert cred .owner_id == profile_owner_id
213219
214220 def test_create_synapse_credential__username_auth_token_mismatch (
215221 self , mocker
0 commit comments