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 +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1- # Test bindings
2- ADD_PYTHON_UNIT_TEST("test-bindings" "unitTesting/test_bindings.py" src)
31
42# Test the interpreter
53SET (EXECUTABLE_NAME interpreter-test )
@@ -59,3 +57,6 @@ TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${PUBLIC_KEYWORD} ${LIBRARY_NAME} ${PYTHO
5957
6058## Test it
6159ADD_PYTHON_UNIT_TEST("test-custom-entity" "unitTesting/test_custom_entity.py" src unitTesting)
60+
61+ # also test other bindings, using this custom entity
62+ ADD_PYTHON_UNIT_TEST("test-bindings" "unitTesting/test_bindings.py" src unitTesting)
Original file line number Diff line number Diff line change 11import unittest
22
3- import dynamic_graph
3+ import dynamic_graph as dg
4+ from custom_entity import CustomEntity
45
56
67class BindingsTests (unittest .TestCase ):
78 def test_bindings (self ):
89 with self .assertRaises (Exception ) as error :
9- dynamic_graph .error_out ()
10+ dg .error_out ()
1011 self .assertEqual (str (error ), "something bad happend" )
1112
13+ def test_type_check (self ):
14+ first = CustomEntity ('first_entity' )
15+ second = CustomEntity ('second_entity' )
16+ # Check that we can connect first.out to second.in
17+ dg .plug (first .signal ('out_double' ), second .signal ('in_double' ))
18+ # Check that we can't connect first.out to second
19+ with self .assertRaises (Exception ):
20+ dg .plug (first .signal ('out_double' ), second )
21+
1222
1323if __name__ == '__main__' :
1424 unittest .main ()
You can’t perform that action at this time.
0 commit comments