This is an automated email from the ASF dual-hosted git repository. jfeinauer pushed a commit to branch feature/PLC4X-111-interop-server in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
commit 82be59e6a98ef6d5df8ad2090d54298067a60576 Author: julian <[email protected]> AuthorDate: Sun Apr 21 14:29:23 2019 +0200 PLC4X-111 Added meaningful test with assert. --- plc4py/test/test_PlcDriverManager.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/plc4py/test/test_PlcDriverManager.py b/plc4py/test/test_PlcDriverManager.py index 2d0dce7..328be71 100644 --- a/plc4py/test/test_PlcDriverManager.py +++ b/plc4py/test/test_PlcDriverManager.py @@ -56,6 +56,30 @@ class TestPlcDriverManager(TestCase): finally: manager.close() + def test_withCompleteAPI(self): + try: + manager = PlcDriverManager() + + connection = None + try: + connection = manager.get_connection("mock:a") + + result = connection.execute(Request(fields={"field1": "asdf"})) + print("Response Code is " + str(result.get_field("field1").get_response_code())) + # We now that we want to get an int... + print("Response Value is " + str(result.get_field("field1").get_int_value())) + + ## Assert the value + self.assertEqual(result.get_field("field1").get_int_value(), 100) + + except PlcException as e: + raise Exception(str(e.url)) + finally: + if connection is not None: + connection.close() + finally: + manager.close() + # This i a manual test, which needs a running server to work def mt_withRealPLC_forDebug(self): try:
