3939from cloudant .error import CloudantArgumentError , CloudantClientException
4040from cloudant .feed import Feed , InfiniteFeed
4141
42- from .unit_t_db_base import skip_for_iam , UnitTestDbBase
42+ from .unit_t_db_base import skip_if_not_cookie_auth , UnitTestDbBase
4343from .. import bytes_ , str_
4444
4545class CloudantClientExceptionTests (unittest .TestCase ):
@@ -164,7 +164,7 @@ def test_multiple_connect(self):
164164 self .client .disconnect ()
165165 self .assertIsNone (self .client .r_session )
166166
167- @skip_for_iam
167+ @skip_if_not_cookie_auth
168168 def test_auto_renew_enabled (self ):
169169 """
170170 Test that CookieSession is used when auto_renew is enabled.
@@ -179,7 +179,7 @@ def test_auto_renew_enabled(self):
179179 finally :
180180 self .client .disconnect ()
181181
182- @skip_for_iam
182+ @skip_if_not_cookie_auth
183183 def test_auto_renew_enabled_with_auto_connect (self ):
184184 """
185185 Test that CookieSession is used when auto_renew is enabled along with
@@ -194,7 +194,7 @@ def test_auto_renew_enabled_with_auto_connect(self):
194194 finally :
195195 self .client .disconnect ()
196196
197- @skip_for_iam
197+ @skip_if_not_cookie_auth
198198 def test_session (self ):
199199 """
200200 Test getting session information.
@@ -210,7 +210,7 @@ def test_session(self):
210210 finally :
211211 self .client .disconnect ()
212212
213- @skip_for_iam
213+ @skip_if_not_cookie_auth
214214 def test_session_cookie (self ):
215215 """
216216 Test getting the session cookie.
@@ -319,7 +319,7 @@ def test_change_credentials_basic(self, m_req):
319319 )
320320 self .assertEquals (all_dbs , ['animaldb' ])
321321
322- @skip_for_iam
322+ @skip_if_not_cookie_auth
323323 def test_basic_auth_str (self ):
324324 """
325325 Test getting the basic authentication string.
@@ -594,7 +594,7 @@ class CloudantClientTests(UnitTestDbBase):
594594 Cloudant specific client unit tests
595595 """
596596
597- @skip_for_iam
597+ @skip_if_not_cookie_auth
598598 def test_cloudant_session_login (self ):
599599 """
600600 Test that the Cloudant client session successfully authenticates.
@@ -607,7 +607,7 @@ def test_cloudant_session_login(self):
607607 self .client .session_login ()
608608 self .assertNotEqual (self .client .session_cookie (), old_cookie )
609609
610- @skip_for_iam
610+ @skip_if_not_cookie_auth
611611 def test_cloudant_session_login_with_new_credentials (self ):
612612 """
613613 Test that the Cloudant client session fails to authenticate when
@@ -620,7 +620,7 @@ def test_cloudant_session_login_with_new_credentials(self):
620620
621621 self .assertTrue (str (cm .exception ).find ('Name or password is incorrect' ))
622622
623- @skip_for_iam
623+ @skip_if_not_cookie_auth
624624 def test_cloudant_context_helper (self ):
625625 """
626626 Test that the cloudant context helper works as expected.
@@ -632,7 +632,7 @@ def test_cloudant_context_helper(self):
632632 except Exception as err :
633633 self .fail ('Exception {0} was raised.' .format (str (err )))
634634
635- @skip_for_iam
635+ @skip_if_not_cookie_auth
636636 def test_cloudant_bluemix_context_helper (self ):
637637 """
638638 Test that the cloudant_bluemix context helper works as expected.
@@ -697,7 +697,7 @@ def test_constructor_with_account(self):
697697 'https://{0}.cloudant.com' .format (self .account )
698698 )
699699
700- @skip_for_iam
700+ @skip_if_not_cookie_auth
701701 def test_bluemix_constructor (self ):
702702 """
703703 Test instantiating a client object using a VCAP_SERVICES environment
@@ -730,7 +730,7 @@ def test_bluemix_constructor(self):
730730 finally :
731731 c .disconnect ()
732732
733- @skip_for_iam
733+ @skip_if_not_cookie_auth
734734 def test_bluemix_constructor_specify_instance_name (self ):
735735 """
736736 Test instantiating a client object using a VCAP_SERVICES environment
@@ -763,7 +763,7 @@ def test_bluemix_constructor_specify_instance_name(self):
763763 finally :
764764 c .disconnect ()
765765
766- @skip_for_iam
766+ @skip_if_not_cookie_auth
767767 def test_bluemix_constructor_with_multiple_services (self ):
768768 """
769769 Test instantiating a client object using a VCAP_SERVICES environment
@@ -831,7 +831,7 @@ def test_connect_headers(self):
831831 finally :
832832 self .client .disconnect ()
833833
834- @skip_for_iam
834+ @skip_if_not_cookie_auth
835835 def test_connect_timeout (self ):
836836 """
837837 Test that a connect timeout occurs when instantiating
@@ -858,7 +858,7 @@ def test_db_updates_infinite_feed_call(self):
858858 finally :
859859 self .client .disconnect ()
860860
861- @skip_for_iam
861+ @skip_if_not_cookie_auth
862862 def test_billing_data (self ):
863863 """
864864 Test the retrieval of billing data
@@ -953,7 +953,7 @@ def test_set_year_with_invalid_month_for_billing_data(self):
953953 finally :
954954 self .client .disconnect ()
955955
956- @skip_for_iam
956+ @skip_if_not_cookie_auth
957957 def test_volume_usage_data (self ):
958958 """
959959 Test the retrieval of volume usage data
@@ -1045,7 +1045,7 @@ def test_set_year_with_invalid_month_for_volume_usage_data(self):
10451045 finally :
10461046 self .client .disconnect ()
10471047
1048- @skip_for_iam
1048+ @skip_if_not_cookie_auth
10491049 def test_requests_usage_data (self ):
10501050 """
10511051 Test the retrieval of requests usage data
@@ -1137,7 +1137,7 @@ def test_set_year_with_invalid_month_for_requests_usage_data(self):
11371137 finally :
11381138 self .client .disconnect ()
11391139
1140- @skip_for_iam
1140+ @skip_if_not_cookie_auth
11411141 def test_shared_databases (self ):
11421142 """
11431143 Test the retrieval of shared database list
@@ -1148,7 +1148,7 @@ def test_shared_databases(self):
11481148 finally :
11491149 self .client .disconnect ()
11501150
1151- @skip_for_iam
1151+ @skip_if_not_cookie_auth
11521152 def test_generate_api_key (self ):
11531153 """
11541154 Test the generation of an API key for this client account
@@ -1162,7 +1162,7 @@ def test_generate_api_key(self):
11621162 finally :
11631163 self .client .disconnect ()
11641164
1165- @skip_for_iam
1165+ @skip_if_not_cookie_auth
11661166 def test_cors_configuration (self ):
11671167 """
11681168 Test the retrieval of the current CORS configuration for this client
@@ -1176,7 +1176,7 @@ def test_cors_configuration(self):
11761176 finally :
11771177 self .client .disconnect ()
11781178
1179- @skip_for_iam
1179+ @skip_if_not_cookie_auth
11801180 def test_cors_origins (self ):
11811181 """
11821182 Test the retrieval of the CORS origins list
@@ -1188,7 +1188,7 @@ def test_cors_origins(self):
11881188 finally :
11891189 self .client .disconnect ()
11901190
1191- @skip_for_iam
1191+ @skip_if_not_cookie_auth
11921192 def test_disable_cors (self ):
11931193 """
11941194 Test disabling CORS (assuming CORS is enabled)
@@ -1209,7 +1209,7 @@ def test_disable_cors(self):
12091209 finally :
12101210 self .client .disconnect ()
12111211
1212- @skip_for_iam
1212+ @skip_if_not_cookie_auth
12131213 def test_update_cors_configuration (self ):
12141214 """
12151215 Test updating CORS configuration
0 commit comments