| Conditions | 1 |
| Total Lines | 6 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | """Module with identifier types for Links and Interfaces""" |
||
| 36 | 1 | def __new__(cls, interface_1: str, interface_2: str): |
|
| 37 | 1 | intf_1 = InterfaceID(*LinkID.intf_id_to_tuple(interface_1)) |
|
| 38 | 1 | intf_2 = InterfaceID(*LinkID.intf_id_to_tuple(interface_2)) |
|
| 39 | 1 | raw_str = ":".join(sorted((intf_1, intf_2))) |
|
| 40 | 1 | digest = hashlib.sha256(raw_str.encode('utf-8')).hexdigest() |
|
| 41 | 1 | return super().__new__(cls, digest) |
|
| 42 | |||
| 50 |