88from slack_bolt .error import BoltError
99from slack_bolt .oauth .async_oauth_flow import AsyncOAuthFlow
1010from slack_bolt .oauth .async_oauth_settings import AsyncOAuthSettings
11- from slack_bolt .oauth .oauth_settings import OAuthSettings
1211from tests .utils import remove_os_env_temporarily , restore_os_env
1312
1413
@@ -90,18 +89,22 @@ def test_valid_multi_auth_client_id_absence(self):
9089 with pytest .raises (BoltError ):
9190 AsyncApp (
9291 signing_secret = "valid" ,
93- oauth_settings = OAuthSettings (client_id = None , client_secret = "valid" ),
92+ oauth_settings = AsyncOAuthSettings (
93+ client_id = None , client_secret = "valid"
94+ ),
9495 )
9596
9697 def test_valid_multi_auth_secret_absence (self ):
9798 with pytest .raises (BoltError ):
9899 AsyncApp (
99100 signing_secret = "valid" ,
100- oauth_settings = OAuthSettings (client_id = "111.222" , client_secret = None ),
101+ oauth_settings = AsyncOAuthSettings (
102+ client_id = "111.222" , client_secret = None
103+ ),
101104 )
102105
103106 def test_authorize_conflicts (self ):
104- oauth_settings = OAuthSettings (
107+ oauth_settings = AsyncOAuthSettings (
105108 client_id = "111.222" ,
106109 client_secret = "valid" ,
107110 installation_store = FileInstallationStore (),
@@ -127,3 +130,37 @@ def authorize() -> AuthorizeResult:
127130
128131 with pytest .raises (BoltError ):
129132 AsyncApp (signing_secret = "valid" , authorize = authorize , oauth_flow = oauth_flow )
133+
134+ def test_installation_store_conflicts (self ):
135+ store1 = FileInstallationStore ()
136+ store2 = FileInstallationStore ()
137+ app = AsyncApp (
138+ signing_secret = "valid" ,
139+ oauth_settings = AsyncOAuthSettings (
140+ client_id = "111.222" , client_secret = "valid" , installation_store = store1 ,
141+ ),
142+ installation_store = store2 ,
143+ )
144+ assert app .installation_store is store1
145+
146+ app = AsyncApp (
147+ signing_secret = "valid" ,
148+ oauth_flow = AsyncOAuthFlow (
149+ settings = AsyncOAuthSettings (
150+ client_id = "111.222" ,
151+ client_secret = "valid" ,
152+ installation_store = store1 ,
153+ )
154+ ),
155+ installation_store = store2 ,
156+ )
157+ assert app .installation_store is store1
158+
159+ app = AsyncApp (
160+ signing_secret = "valid" ,
161+ oauth_flow = AsyncOAuthFlow (
162+ settings = AsyncOAuthSettings (client_id = "111.222" , client_secret = "valid" ,)
163+ ),
164+ installation_store = store1 ,
165+ )
166+ assert app .installation_store is store1
0 commit comments