File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,30 @@ def test_md5(db_kwargs):
9696 redshift_connector .connect (** db_kwargs )
9797
9898
99+ @pytest .mark .parametrize ("algorithm" , ("sha256" ,))
100+ def test_auth_req_digest (db_kwargs , algorithm ):
101+ test_user : str = "{}_dbuser" .format (algorithm )
102+ test_password : str = "My_{}_PaSsWoRdŽ" .format (algorithm )
103+ with redshift_connector .connect (** db_kwargs ) as conn :
104+ with conn .cursor () as cursor :
105+ cursor .execute ("drop user if exists {}" .format (test_user ))
106+ cursor .execute (
107+ "create user {} with password '{}'" .format (test_user , "{}|{}" .format (algorithm , test_password ))
108+ )
109+ conn .commit ()
110+ try :
111+ with redshift_connector .connect (** {** db_kwargs , ** {"user" : test_user , "password" : test_password }}) as conn :
112+ with conn .cursor () as cursor :
113+ cursor .execute ("select 1" )
114+ except :
115+ raise
116+ finally :
117+ with redshift_connector .connect (** db_kwargs ) as conn :
118+ with conn .cursor () as cursor :
119+ cursor .execute ("drop user if exists {}" .format (test_user ))
120+ conn .commit ()
121+
122+
99123@pytest .mark .usefixtures ("trust_all_certificates" )
100124def test_ssl (db_kwargs ):
101125 db_kwargs ["ssl" ] = True
You can’t perform that action at this time.
0 commit comments