1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/usr/bin/env python
import unittest
from pymodbus.client.asynchronous import ModbusSerialClient as ModbusClient
from base_runner import Runner
class AsynchronousRtuClient(Runner, unittest.TestCase):
"""
These are the integration tests for the asynchronous
serial rtu client.
"""
def setUp(self):
""" Initializes the test environment """
super(Runner, self).setUp()
self.client = ModbusClient(method='rtu')
def tearDown(self):
""" Cleans up the test environment """
self.client.close()
super(Runner, self).tearDown()
# --------------------------------------------------------------------------- #
# Main
# --------------------------------------------------------------------------- #
if __name__ == "__main__":
unittest.main()
|