Skip to content

Commit 69ee69d

Browse files
authored
Make DutIdentifier serialisable (#13)
* Add _asdict so dut ID can be serialised * Use dataclasses asdict
1 parent 2c28b0e commit 69ee69d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

openhtf/core/dut_id.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import dataclasses
12
from typing import Optional
23
from dataclasses import dataclass, field
34

@@ -13,3 +14,6 @@ class DutIdentifier:
1314
@property
1415
def test_id(self) -> str:
1516
return self.halter_serial_number
17+
18+
def _asdict(self) -> dict:
19+
return dataclasses.asdict(self)

0 commit comments

Comments
 (0)