diff options
author | Chris Liechti <cliechti@gmx.net> | 2015-10-30 23:46:15 +0100 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2015-10-30 23:46:15 +0100 |
commit | 3fcb192384b2b07a39aa3dcb5f89a8194fd613da (patch) | |
tree | 47bd53c55f26de9681ff72fac74f906687e60721 /test | |
parent | 03cb8ed2a73a391dd181c970f85642e65e75e677 (diff) | |
download | pyserial-git-3fcb192384b2b07a39aa3dcb5f89a8194fd613da.tar.gz |
add minimal test for RFC 2217 client
- add new file to MANIFEST.in
- sort entries MANIFEST.in
Diffstat (limited to 'test')
-rw-r--r-- | test/test_rfc2217.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test_rfc2217.py b/test/test_rfc2217.py new file mode 100644 index 0000000..05bee83 --- /dev/null +++ b/test/test_rfc2217.py @@ -0,0 +1,31 @@ +#! /usr/bin/env python +# +# This file is part of pySerial - Cross platform serial port support for Python +# (C) 2015 Chris Liechti <cliechti@gmx.net> +# +# SPDX-License-Identifier: BSD-3-Clause +"""\ +Test RFC 2217 related functionality. +""" + +import unittest +import serial +import serial.rfc2217 + +class Test_RFC2217(unittest.TestCase): + """Test RFC 2217 related functionality""" + + def test_failed_connection(self): + # connection to closed port + s = serial.serial_for_url('rfc2217://127.99.99.99:2217', do_not_open=True) + self.failUnlessRaises(serial.SerialException, s.open) + self.assertFalse(s.is_open) + + +if __name__ == '__main__': + import sys + sys.stdout.write(__doc__) + sys.stdout.write("Testing connection on localhost\n") + sys.argv[1:] = ['-v'] + # When this module is executed from the command-line, it runs all its tests + unittest.main() |