Skip to content

Commit f77a711

Browse files
committed
Migrate integration tests to apiver v3
1 parent 30def6f commit f77a711

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

test/integration/bucket_cleaner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
import logging
1313

14-
from b2sdk.v2 import (
14+
from b2sdk.v3 import (
1515
NO_RETENTION_FILE_SETTING,
1616
B2Api,
1717
Bucket,
1818
LegalHold,
1919
RetentionMode,
2020
current_time_millis,
2121
)
22-
from b2sdk.v2.exception import BadRequest
22+
from b2sdk.v3.exception import BadRequest
2323

2424
from .helpers import BUCKET_CREATED_AT_MILLIS, GENERAL_BUCKET_NAME_PREFIX
2525

test/integration/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import os
1313
import secrets
1414

15-
from b2sdk.v2 import (
15+
from b2sdk.v3 import (
1616
BUCKET_NAME_CHARS_UNIQ,
1717
BUCKET_NAME_LENGTH_RANGE,
1818
DEFAULT_HTTP_API_CONFIG,
@@ -43,5 +43,5 @@ def authorize(b2_auth_data, api_config=DEFAULT_HTTP_API_CONFIG):
4343
info = InMemoryAccountInfo()
4444
b2_api = B2Api(info, api_config=api_config)
4545
realm = os.environ.get('B2_TEST_ENVIRONMENT', 'production')
46-
b2_api.authorize_account(realm, *b2_auth_data)
46+
b2_api.authorize_account(*b2_auth_data, realm=realm)
4747
return b2_api, info

test/integration/test_download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from b2sdk._internal.utils import Sha1HexDigest
2424
from b2sdk._internal.utils.filesystem import _IS_WINDOWS
25-
from b2sdk.v2 import *
25+
from b2sdk.v3 import *
2626

2727
from .base import IntegrationTestBase
2828
from .helpers import authorize

test/integration/test_raw_api.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def raw_api_test_helper(raw_api, should_cleanup_old_buckets):
119119
set(ALL_CAPABILITIES)
120120
- {'readBuckets', 'listAllBucketNames'}
121121
- preview_feature_caps
122-
- set(auth_dict['apiInfo']['storageApi']['capabilities'])
122+
- set(auth_dict['apiInfo']['storageApi']['allowed']['capabilities'])
123123
)
124124
assert not missing_capabilities, f'it appears that the raw_api integration test is being run with a non-full key. Missing capabilities: {missing_capabilities}'
125125

@@ -599,7 +599,10 @@ def raw_api_test_helper(raw_api, should_cleanup_old_buckets):
599599

600600

601601
def _subtest_bucket_notification_rules(raw_api, auth_dict, api_url, account_auth_token, bucket_id):
602-
if 'writeBucketNotifications' not in auth_dict['apiInfo']['storageApi']['capabilities']:
602+
if (
603+
'writeBucketNotifications'
604+
not in auth_dict['apiInfo']['storageApi']['allowed']['capabilities']
605+
):
603606
pytest.skip('Test account does not have writeBucketNotifications capability')
604607

605608
notification_rule = {

test/integration/test_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import pytest
1616

17-
from b2sdk.v2 import (
17+
from b2sdk.v3 import (
1818
CompareVersionMode,
1919
NewerFileSyncMode,
2020
Synchronizer,

0 commit comments

Comments
 (0)