~ubuntu-branches/ubuntu/raring/pymodbus/raring-proposed

« back to all changes in this revision

Viewing changes to examples/functional/asynchronous-rtu-client.py

  • Committer: Package Import Robot
  • Author(s): W. Martin Borgert
  • Date: 2011-10-26 07:26:28 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20111026072628-fvzyi6tnb8iipomp
Tags: 0.9.0+r175-1
* Update from trunk to get a number of upstream fixes.
* Removed examples/tools/ (not present in previous version
  anyway) from source because there are different licenses
  involved. Needs clarification.
* Dont't install unit tests.
* Debian patches not necessary anymore.

Show diffs side-by-side

added added

removed removed

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