This repository was archived by the owner on Nov 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ PyObject* plug(
4949 if (signalIn == NULL ) {
5050 struct module_state * st = GETSTATE (m);
5151 std::ostringstream oss;
52- oss << " dgpy.plug in argument must be a dynamic_graph.Signal, not a " << PyCapsule_GetName (objIn);
52+ oss << " dynamic_graph.plug(a, b): Argument 'b' must be of type 'dynamic_graph.Signal', but got "
53+ << PyCapsule_GetName (objIn);
5354 PyErr_SetString (st->dgpyError , oss.str ().c_str ());
5455 return NULL ;
5556 }
@@ -58,7 +59,8 @@ PyObject* plug(
5859 if (signalOut == NULL ) {
5960 struct module_state * st = GETSTATE (m);
6061 std::ostringstream oss;
61- oss << " dgpy.plug out argument must be a dynamic_graph.Signal, not a " << PyCapsule_GetName (objOut);
62+ oss << " dynamic_graph.plug(a, b): Argument 'a' must be of type 'dynamic_graph.Signal', but got "
63+ << PyCapsule_GetName (objOut);
6264 PyErr_SetString (st->dgpyError , oss.str ().c_str ());
6365 return NULL ;
6466 }
Original file line number Diff line number Diff line change 44
55from custom_entity import CustomEntity
66
7+ ERR = "dynamic_graph.plug(a, b): Argument '%s' must be of type 'dynamic_graph.Signal', but got dynamic_graph.Entity"
8+
79
810class BindingsTests (unittest .TestCase ):
911 def test_bindings (self ):
@@ -20,14 +22,12 @@ def test_type_check(self):
2022 # Check that we can't connect first.out to second
2123 with self .assertRaises (dg .dgpyError ) as cm_in :
2224 dg .plug (first .signal ('out_double' ), second )
23- self .assertEqual (str (cm_in .exception ),
24- "dgpy.plug in argument must be a dynamic_graph.Signal, not a dynamic_graph.Entity" )
25+ self .assertEqual (str (cm_in .exception ), ERR % 'b' )
2526
2627 # Check that we can't connect first to second.in
2728 with self .assertRaises (dg .dgpyError ) as cm_out :
2829 dg .plug (first , second .signal ('in_double' ))
29- self .assertEqual (str (cm_out .exception ),
30- "dgpy.plug out argument must be a dynamic_graph.Signal, not a dynamic_graph.Entity" )
30+ self .assertEqual (str (cm_out .exception ), ERR % 'a' )
3131
3232
3333if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments