Skip to content

Commit e7d328b

Browse files
committed
lib.wiring: test ComponentMetadata.as_json() with a flipped signature.
1 parent 95a80f6 commit e7d328b

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

tests/test_lib_wiring.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,17 +1199,18 @@ def __init__(self):
11991199
})
12001200

12011201
def annotations(self, obj):
1202-
return (*super().annotations(obj), Annotation1())
1202+
return (*Signature.annotations(self, obj), Annotation1())
12031203

12041204
class Signature2(Signature):
12051205
def __init__(self):
12061206
super().__init__({
12071207
"clk": In(1),
12081208
"foo": Out(Signature1()),
1209+
"oof": In(Signature1())
12091210
})
12101211

12111212
def annotations(self, obj):
1212-
return (*super().annotations(obj), Annotation1())
1213+
return (*Signature.annotations(self, obj), Annotation1())
12131214

12141215
class A(Component):
12151216
def __init__(self):
@@ -1253,6 +1254,32 @@ def __init__(self):
12531254
},
12541255
},
12551256
},
1257+
"oof": {
1258+
"type": "interface",
1259+
"members": {
1260+
"i": {
1261+
"type": "port",
1262+
"name": "oof__i",
1263+
"dir": "out",
1264+
"width": 8,
1265+
"signed": False,
1266+
"init": "42",
1267+
},
1268+
"o": {
1269+
"type": "port",
1270+
"name": "oof__o",
1271+
"dir": "in",
1272+
"width": 4,
1273+
"signed": True,
1274+
"init": "0",
1275+
},
1276+
},
1277+
"annotations": {
1278+
"https://example.com/schema/foo/0.1/bar.json": {
1279+
"hello": True,
1280+
},
1281+
},
1282+
},
12561283
},
12571284
"annotations": {
12581285
"https://example.com/schema/foo/0.1/bar.json": {

0 commit comments

Comments
 (0)