From 18e37fc22f9b1f944d95e338f154736416464037 Mon Sep 17 00:00:00 2001 From: petersulyok Date: Sun, 10 Mar 2024 22:25:49 +0100 Subject: [PATCH] Fix: unit tests updated to new fixed encoding. --- test/test_data.py | 4 ++-- test/test_partition.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_data.py b/test/test_data.py index 0524eeb..43229ff 100644 --- a/test/test_data.py +++ b/test/test_data.py @@ -238,7 +238,7 @@ def create_partitions(self, disk_idx: int, part_num: int) -> None: if " " in part_label: part_label = part_label.replace(" ", "\\x20") if part_label: - part.bypartlabel_path = "/dev/disk/by-partlabel/" + part.part_label + part.bypartlabel_path = "/dev/disk/by-partlabel/" + part_label else: part.bypartlabel_path = "" part.part_scheme = random.choice(["gtp", "mbr"]) @@ -261,7 +261,7 @@ def create_partitions(self, disk_idx: int, part_num: int) -> None: fs_label = fs_label.replace(" ", "_") fs_label_enc = fs_label_enc.replace(" ", "\\x20") if fs_label: - part.bylabel_path = "/dev/disk/by-label/" + part.fs_label + part.bylabel_path = "/dev/disk/by-label/" + fs_label_enc else: part.bylabel_path = "" part.fs_uuid = str(uuid.uuid4()) diff --git a/test/test_partition.py b/test/test_partition.py index a9ad9e4..8f10e4d 100644 --- a/test/test_partition.py +++ b/test/test_partition.py @@ -146,7 +146,7 @@ def mocked_run(*args, **kwargs): Partition(part_name, part_devid) self.assertTrue(type(cm.exception) in exceptions, error) - def test_init_file(self): + def test_init(self): """Unit test for Partition.__init__() method.""" # Test an HDD with 4 partitions.