Skip to content

Commit

Permalink
python: fix pylint
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishek Gaikwad <[email protected]>
  • Loading branch information
gaikwadabhishek committed Jan 17, 2024
1 parent af123b8 commit ea3efca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
11 changes: 11 additions & 0 deletions python/tests/integration/sdk/remote_enabled_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

import unittest
import boto3

from aistore.sdk.const import PROVIDER_AIS

Expand All @@ -15,6 +16,8 @@
TEST_TIMEOUT_LONG,
)
from tests.utils import random_string, destroy_bucket, create_and_put_objects
from tests import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
from tests.integration.boto3 import AWS_REGION


class RemoteEnabledTest(unittest.TestCase):
Expand Down Expand Up @@ -137,3 +140,11 @@ def _verify_cached_objects(self, expected_object_count, cached_range):
evicted_objs.append(obj)
self._validate_objects_cached(cached_objs, True)
self._validate_objects_cached(evicted_objs, False)

def _get_boto3_client(self):
return boto3.client(
"s3",
region_name=AWS_REGION,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
)
10 changes: 1 addition & 9 deletions python/tests/integration/sdk/test_bucket_ops_stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,17 @@
#
import unittest
import random
import boto3

from tests.integration import REMOTE_SET, TEST_TIMEOUT, STRESS_TEST_OBJECT_COUNT
from tests.integration.sdk.remote_enabled_test import RemoteEnabledTest
from tests import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
from tests.integration.boto3 import AWS_REGION


# pylint: disable=unused-variable,too-many-instance-attributes
class TestBucketOpsStress(RemoteEnabledTest):
def setUp(self) -> None:
super().setUp()
if REMOTE_SET:
self.s3_client = boto3.client(
"s3",
region_name=AWS_REGION,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
)
self.s3_client = self._get_boto3_client()

@unittest.skipIf(
not REMOTE_SET,
Expand Down
10 changes: 1 addition & 9 deletions python/tests/integration/sdk/test_object_group_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import unittest
import tarfile
import io
import boto3

import pytest

Expand All @@ -14,8 +13,6 @@
from tests.integration import REMOTE_SET, TEST_TIMEOUT, OBJECT_COUNT
from tests.integration.sdk.remote_enabled_test import RemoteEnabledTest
from tests.utils import random_string
from tests import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
from tests.integration.boto3 import AWS_REGION


# pylint: disable=unused-variable,too-many-instance-attributes
Expand All @@ -24,12 +21,7 @@ def setUp(self) -> None:
super().setUp()
self.obj_names = self._create_objects(suffix="-suffix")
if REMOTE_SET:
self.s3_client = boto3.client(
"s3",
region_name=AWS_REGION,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
)
self.s3_client = self._get_boto3_client()

def test_delete(self):
object_group = self.bucket.objects(obj_names=self.obj_names[1:])
Expand Down

0 comments on commit ea3efca

Please sign in to comment.