Skip to content

Commit 2ac07f6

Browse files
committed
Field as purepath in model
1 parent 3801091 commit 2ac07f6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

aiohasupervisor/models/os.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from dataclasses import dataclass
44
from enum import StrEnum
5+
from pathlib import PurePath
56

67
from .base import Options, Request, ResponseData
78

@@ -72,7 +73,7 @@ class DataDisk(ResponseData):
7273
serial: str
7374
size: int
7475
id: str
75-
dev_path: str
76+
dev_path: PurePath
7677

7778

7879
@dataclass(frozen=True, slots=True)

tests/test_os.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Test OS supervisor client."""
22

3+
from pathlib import PurePath
4+
35
from aioresponses import aioresponses
46
from yarl import URL
57

@@ -84,7 +86,7 @@ async def test_os_list_data_disks(
8486
assert datadisks.disks[0].model == "SSK Storage"
8587
assert datadisks.disks[0].serial == "DF123"
8688
assert datadisks.disks[0].name == "SSK SSK Storage (DF123)"
87-
assert datadisks.disks[0].dev_path == "/dev/sda"
89+
assert datadisks.disks[0].dev_path == PurePath("/dev/sda")
8890

8991

9092
async def test_os_wipe_data(

0 commit comments

Comments
 (0)