Skip to content

Commit 4d433c4

Browse files
author
Kamil Gierszewski
committed
tests: fix pep8 style violation
Signed-off-by: Kamil Gierszewski <[email protected]>
1 parent 417ab1a commit 4d433c4

File tree

78 files changed

+264
-274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+264
-274
lines changed

test/functional/api/cas/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __get_cache_device(self) -> Device | None:
5050
if not cache:
5151
return None
5252

53-
if cache["device_path"] is "-":
53+
if cache["device_path"] == "-":
5454
return None
5555

5656
return Device(path=cache["device_path"])

test/functional/api/cas/cas_packaging.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Copyright(c) 2022 Intel Corporation
3-
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
3+
# Copyright(c) 2024-2025 Huawei Technologies Co., Ltd.
44
# SPDX-License-Identifier: BSD-3-Clause
55
#
66

@@ -49,7 +49,7 @@ def create(
4949
arch: str = "",
5050
source: bool = False,
5151
):
52-
TestRun.LOGGER.info(f"Creating Open CAS RPM packages")
52+
TestRun.LOGGER.info("Creating Open CAS RPM packages")
5353

5454
self.packages_dir = (
5555
packages_dir or self.packages_dir or os.path.join(sources_dir, "packages")
@@ -79,7 +79,7 @@ def create(
7979
arch: str = "",
8080
source: bool = False,
8181
):
82-
TestRun.LOGGER.info(f"Creating Open CAS DEB packages")
82+
TestRun.LOGGER.info("Creating Open CAS DEB packages")
8383

8484
self.packages_dir = (
8585
packages_dir or self.packages_dir or os.path.join(sources_dir, "packages")

test/functional/api/cas/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def script_try_add_cmd(cache_id: str, core_dev: str, core_id: str) -> str:
447447
command = " --script --add-core --try-add"
448448
command += " --cache-id " + cache_id
449449
command += " --core-device " + core_dev
450-
command += f" --core-id " + core_id
450+
command += "--core-id " + core_id
451451
return casadm_bin + command
452452

453453

test/functional/tests/512b/test_different_io_sizes_support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_support_different_io_size(cache_mode):
5555
core.create_filesystem(Filesystem.xfs)
5656
core.mount(mountpoint)
5757

58-
with TestRun.step(f"Run fio"):
58+
with TestRun.step("Run fio"):
5959
bs_list = [Size(x, Unit.KibiByte) for x in block_sizes]
6060

6161
fio = (

test/functional/tests/basic/test_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_cas_version():
5151

5252
with TestRun.step("Compare cmd and file versions"):
5353
if not all(file_cas_version == cmd_cas_version for cmd_cas_version in cmd_cas_versions):
54-
TestRun.LOGGER.error(f"Cmd and file versions doesn't match")
54+
TestRun.LOGGER.error("Cmd and file versions doesn't match")
5555

5656

5757
@pytest.mark.CI

test/functional/tests/cache_ops/test_attach_detach.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from api.cas.cli import attach_cache_cmd
1515
from api.cas.cli_messages import check_stderr_msg, attach_with_existing_metadata
1616
from connection.utils.output import CmdException
17-
from core.test_run import TestRun
1817
from core.test_run_utils import TestRun
1918
from storage_devices.disk import DiskTypeSet, DiskType, DiskTypeLowerThan
2019
from storage_devices.nullblk import NullBlk
@@ -225,7 +224,7 @@ def test_stop_cache_during_attach(cache_mode):
225224
core_dev.create_partitions([Size(2, Unit.GibiByte)])
226225
core_dev = core_dev.partitions[0]
227226

228-
with TestRun.step(f"Start cache and add core"):
227+
with TestRun.step("Start cache and add core"):
229228
cache = casadm.start_cache(cache_dev, force=True, cache_mode=cache_mode)
230229
cache.add_core(core_dev)
231230

@@ -259,4 +258,4 @@ def _get_random_uniq_cache_line_size(cache_line_size) -> CacheLineSize:
259258

260259

261260
def _get_random_uniq_cache_mode(cache_mode) -> CacheMode:
262-
return random.choice([c for c in list(CacheMode) if c is not cache_mode])
261+
return random.choice([c for c in list(CacheMode) if c is not cache_mode])

test/functional/tests/cache_ops/test_dynamic_cache_mode_switching.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_cache_stop_and_load(cache_mode):
6161
core_dev = TestRun.disks["core"]
6262
core_dev.create_partitions([Size(2, Unit.GibiByte)])
6363

64-
with TestRun.step(f"Disable udev"):
64+
with TestRun.step("Disable udev"):
6565
Udev.disable()
6666

6767
with TestRun.step(f"Start cache in {cache_mode[0]} mode"):

test/functional/tests/cache_ops/test_multistream_seq_cutoff.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_multistream_seq_cutoff_functional(streams_number, threshold):
5757
with TestRun.step("Disable udev"):
5858
Udev.disable()
5959

60-
with TestRun.step(f"Start cache in Write-Back cache mode"):
60+
with TestRun.step("Start cache in Write-Back cache mode"):
6161
cache_disk = TestRun.disks["cache"]
6262
core_disk = TestRun.disks["core"]
6363
cache = casadm.start_cache(cache_disk, CacheMode.WB, force=True)
@@ -154,16 +154,16 @@ def test_multistream_seq_cutoff_stress_raw(streams_seq_rand):
154154

155155
cache_disk.create_partitions([Size(1.5, Unit.GibiByte)])
156156

157-
with TestRun.step(f"Disable udev"):
157+
with TestRun.step("Disable udev"):
158158
Udev.disable()
159159

160-
with TestRun.step(f"Start cache in Write-Back mode and add core"):
160+
with TestRun.step("Start cache in Write-Back mode and add core"):
161161
cache = casadm.start_cache(
162162
cache_dev=cache_disk.partitions[0], cache_mode=CacheMode.WB, force=True
163163
)
164164
core = cache.add_core(core_disk)
165165

166-
with TestRun.step(f"Set seq-cutoff policy to always and threshold to 512KiB"):
166+
with TestRun.step("Set seq-cutoff policy to always and threshold to 512KiB"):
167167
core.set_seq_cutoff_policy(SeqCutOffPolicy.always)
168168
core.set_seq_cutoff_threshold(Size(512, Unit.KibiByte))
169169

test/functional/tests/cache_ops/test_seq_cutoff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def test_seq_cutoff_thresh(cache_line_size, io_dir, policy, verify_type):
312312
with TestRun.step("Disable udev"):
313313
Udev.disable()
314314

315-
with TestRun.step(f"Start cache and add core"):
315+
with TestRun.step("Start cache and add core"):
316316
cache = casadm.start_cache(
317317
cache_dev=cache_part,
318318
force=True,
@@ -396,7 +396,7 @@ def test_seq_cutoff_thresh_fill(cache_line_size, io_dir):
396396
with TestRun.step("Disable udev"):
397397
Udev.disable()
398398

399-
with TestRun.step(f"Start cache and add core"):
399+
with TestRun.step("Start cache and add core"):
400400
cache = casadm.start_cache(
401401
cache_dev=cache_part,
402402
force=True,

test/functional/tests/cli/test_cleaning_policy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from core.test_run_utils import TestRun
1111
from type_def.size import Size, Unit
12-
from core.test_run import TestRun
1312
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
1413
from test_tools.fio.fio import Fio
1514
from test_tools.fio.fio_param import ReadWrite, IoEngine
@@ -47,7 +46,7 @@ def test_cleaning_policy_change():
4746
with TestRun.step("Disable udev"):
4847
Udev.disable()
4948

50-
with TestRun.step(f"Start cache in Write-Back mode and set cleaning policy to NOP"):
49+
with TestRun.step("Start cache in Write-Back mode and set cleaning policy to NOP"):
5150
cache = casadm.start_cache(cache_dev, cache_mode=CacheMode.WB, force=True)
5251
cache.set_cleaning_policy(CleaningPolicy.nop)
5352

0 commit comments

Comments
 (0)