@@ -117,16 +117,16 @@ def raw_api_test_helper(raw_api, should_cleanup_old_buckets):
117
117
}
118
118
missing_capabilities = (
119
119
set (ALL_CAPABILITIES ) - {'readBuckets' , 'listAllBucketNames' } - preview_feature_caps -
120
- set (auth_dict ['allowed ' ]['capabilities' ])
120
+ set (auth_dict ['apiInfo' ][ 'storageApi ' ]['capabilities' ])
121
121
)
122
122
assert not missing_capabilities , 'it appears that the raw_api integration test is being run with a non-full key. Missing capabilities: {}' .format (
123
123
missing_capabilities ,
124
124
)
125
125
126
126
account_id = auth_dict ['accountId' ]
127
127
account_auth_token = auth_dict ['authorizationToken' ]
128
- api_url = auth_dict ['apiUrl' ]
129
- download_url = auth_dict ['downloadUrl' ]
128
+ api_url = auth_dict ['apiInfo' ][ 'storageApi' ][ ' apiUrl' ]
129
+ download_url = auth_dict ['apiInfo' ][ 'storageApi' ][ ' downloadUrl' ]
130
130
131
131
# b2_create_key
132
132
print ('b2_create_key' )
@@ -599,7 +599,7 @@ def raw_api_test_helper(raw_api, should_cleanup_old_buckets):
599
599
600
600
601
601
def _subtest_bucket_notification_rules (raw_api , auth_dict , api_url , account_auth_token , bucket_id ):
602
- if 'writeBucketNotifications' not in auth_dict ['allowed ' ]['capabilities' ]:
602
+ if 'writeBucketNotifications' not in auth_dict ['apiInfo' ][ 'storageApi ' ]['capabilities' ]:
603
603
pytest .skip ('Test account does not have writeBucketNotifications capability' )
604
604
605
605
notification_rule = {
@@ -645,8 +645,11 @@ def _subtest_bucket_notification_rules(raw_api, auth_dict, api_url, account_auth
645
645
def cleanup_old_buckets ():
646
646
raw_api = B2RawHTTPApi (B2Http ())
647
647
auth_dict = authorize_raw_api (raw_api )
648
+
648
649
bucket_list_dict = raw_api .list_buckets (
649
- auth_dict ['apiUrl' ], auth_dict ['authorizationToken' ], auth_dict ['accountId' ]
650
+ auth_dict ['apiInfo' ]['storageApi' ]['apiUrl' ],
651
+ auth_dict ['authorizationToken' ],
652
+ auth_dict ['accountId' ],
650
653
)
651
654
_cleanup_old_buckets (raw_api , auth_dict , bucket_list_dict )
652
655
@@ -659,7 +662,7 @@ def _cleanup_old_buckets(raw_api, auth_dict, bucket_list_dict):
659
662
print ('cleaning up old bucket: ' + bucket_name )
660
663
_clean_and_delete_bucket (
661
664
raw_api ,
662
- auth_dict ['apiUrl' ],
665
+ auth_dict ['apiInfo' ][ 'storageApi' ][ ' apiUrl' ],
663
666
auth_dict ['authorizationToken' ],
664
667
auth_dict ['accountId' ],
665
668
bucket_id ,
0 commit comments