This repository was archived by the owner on Aug 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 3838from cloudant .feed import Feed , InfiniteFeed
3939from tests .unit ._test_util import LONG_NUMBER
4040
41- from .unit_t_db_base import skip_if_not_cookie_auth , UnitTestDbBase
41+ from .unit_t_db_base import skip_if_not_cookie_auth , UnitTestDbBase , skip_if_iam
4242from .. import unicode_
4343
4444class CloudantDatabaseExceptionTests (unittest .TestCase ):
@@ -863,7 +863,7 @@ def test_get_show_result(self):
863863 resp ,
864864 'Hello from doc001!'
865865 )
866-
866+ @ skip_if_iam
867867 def test_create_doc_with_update_handler (self ):
868868 """
869869 Test update_handler_result executes an update handler function
@@ -884,6 +884,7 @@ def test_create_doc_with_update_handler(self):
884884 'Created new doc: {"message":"hello","_id":"testDoc"}'
885885 )
886886
887+ @skip_if_iam
887888 def test_update_doc_with_update_handler (self ):
888889 """
889890 Test update_handler_result executes an update handler function
Original file line number Diff line number Diff line change 3232from cloudant .view import View , QueryIndexView
3333from cloudant .error import CloudantArgumentError , CloudantDesignDocumentException
3434
35- from .unit_t_db_base import UnitTestDbBase
35+ from .unit_t_db_base import UnitTestDbBase , skip_if_iam
3636
3737class CloudantDesignDocumentExceptionTests (unittest .TestCase ):
3838 """
@@ -1252,6 +1252,7 @@ def test_get_search_index(self):
12521252 '{"store": true}); }\n }' }
12531253 )
12541254
1255+ @skip_if_iam
12551256 def test_rewrite_rule (self ):
12561257 """
12571258 Test that design document URL is rewritten to the expected test document.
Original file line number Diff line number Diff line change @@ -78,6 +78,13 @@ def wrapper(*args):
7878 return wrapper
7979
8080
81+ def skip_if_iam (f ):
82+ def wrapper (* args ):
83+ if os .environ .get ('IAM_API_KEY' ):
84+ raise unittest .SkipTest ('Test only supports non-IAM authentication' )
85+ return f (* args )
86+ return wrapper
87+
8188class UnitTestDbBase (unittest .TestCase ):
8289 """
8390 The base class for all unit tests targeting a database
You can’t perform that action at this time.
0 commit comments