lib.wiring: fix __repr__ for PureInterface subclasses.

Fixes #988.
This commit is contained in:
Catherine 2023-12-05 04:40:16 +00:00
parent 0cdcab0fbb
commit 120375dabe
2 changed files with 7 additions and 1 deletions

View file

@ -671,6 +671,12 @@ class PureInterfaceTestCase(unittest.TestCase):
intf = PureInterface(sig, path=("test",))
self.assertEqual(repr(intf), "<PureInterface: Signature({'a': In(4), 'b': Out(signed(2))}), a=(sig test__a), b=(sig test__b)>")
def test_repr_inherit(self):
class CustomInterface(PureInterface):
pass
intf = CustomInterface(Signature({}), path=())
self.assertRegex(repr(intf), r"^<CustomInterface: .+?>$")
class FlippedInterfaceTestCase(unittest.TestCase):
def test_basic(self):