lib.wiring: make values of In
and Out
be strings "In" and "Out".
Their `str()` and `repr()` values are already that; and the 0 and 1 don't make sense. The RFC leaves it unspecified.
This commit is contained in:
parent
3d0c5426df
commit
b9c2404f22
|
@ -15,8 +15,8 @@ __all__ = ["In", "Out", "Signature", "PureInterface", "connect", "flipped", "Com
|
|||
|
||||
|
||||
class Flow(enum.Enum):
|
||||
Out = 0
|
||||
In = 1
|
||||
Out = "Out"
|
||||
In = "In"
|
||||
|
||||
def flip(self):
|
||||
if self == Out:
|
||||
|
|
|
@ -26,6 +26,10 @@ class FlowTestCase(unittest.TestCase):
|
|||
self.assertEqual(str(Flow.In), "In")
|
||||
self.assertEqual(str(Flow.Out), "Out")
|
||||
|
||||
def test_flow_value(self):
|
||||
self.assertEqual(Flow.In.value, "In")
|
||||
self.assertEqual(Flow.Out.value, "Out")
|
||||
|
||||
|
||||
class MemberTestCase(unittest.TestCase):
|
||||
def test_port_member(self):
|
||||
|
|
Loading…
Reference in a new issue