diff --git a/test/integration/test_bucket.py b/test/integration/test_bucket.py index 13e1ed18..0f7e640d 100644 --- a/test/integration/test_bucket.py +++ b/test/integration/test_bucket.py @@ -7,7 +7,13 @@ # License https://www.backblaze.com/using_b2_code.html # ###################################################################### -def test_bucket_notification_rules(bucket): +import pytest + + +def test_bucket_notification_rules(bucket, b2_api): + if 'writeBucketNotifications' not in b2_api.account_info.get_allowed()['capabilities']: + pytest.skip('Test account does not have writeBucketNotifications capability') + assert bucket.set_notification_rules([]) == [] assert bucket.get_notification_rules() == [] diff --git a/test/integration/test_raw_api.py b/test/integration/test_raw_api.py index 1ed0faaa..cbf5e873 100644 --- a/test/integration/test_raw_api.py +++ b/test/integration/test_raw_api.py @@ -110,8 +110,15 @@ def raw_api_test_helper(raw_api, should_cleanup_old_buckets): # b2_authorize_account print('b2_authorize_account') auth_dict = authorize_raw_api(raw_api) - missing_capabilities = set(ALL_CAPABILITIES) - {'readBuckets', 'listAllBucketNames' - } - set(auth_dict['allowed']['capabilities']) + + preview_feature_caps = { + 'readBucketNotifications', + 'writeBucketNotifications', + } + missing_capabilities = ( + set(ALL_CAPABILITIES) - {'readBuckets', 'listAllBucketNames'} - preview_feature_caps - + set(auth_dict['allowed']['capabilities']) + ) assert not missing_capabilities, 'it appears that the raw_api integration test is being run with a non-full key. Missing capabilities: {}'.format( missing_capabilities, )