File: test_fixes.py

package info (click to toggle)
pymodbus 2.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,708 kB
  • sloc: python: 17,594; makefile: 84; sh: 8
file content (28 lines) | stat: -rw-r--r-- 848 bytes parent folder | download | duplicates (4)
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
27
28
#!/usr/bin/env python
import unittest

class ModbusFixesTest(unittest.TestCase):
    '''
    This is the unittest for the pymodbus._version code
    '''

    def testTrueFalseDefined(self):
        ''' Test that True and False are defined on all versions'''
        try:
            True,False
        except NameError:
            import pymodbus
            self.assertEqual(True, 1)
            self.assertEqual(False, 1)

    def testNullLoggerAttached(self):
        ''' Test that the null logger is attached'''
        import logging
        logger = logging.getLogger('pymodbus')
        self.assertEqual(len(logger.handlers), 1)

#---------------------------------------------------------------------------#
# Main
#---------------------------------------------------------------------------#
if __name__ == "__main__":
    unittest.main()