summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Liechti <cliechti@gmx.net>2015-10-31 23:31:26 +0100
committerChris Liechti <cliechti@gmx.net>2015-10-31 23:31:26 +0100
commitbb5341b6f19e68ae59b7cccf83d4b363f10330bf (patch)
tree316045cf0cf6046aff04a12fccfa98c416a79f6d /test
parent3fcb192384b2b07a39aa3dcb5f89a8194fd613da (diff)
downloadpyserial-git-bb5341b6f19e68ae59b7cccf83d4b363f10330bf.tar.gz
rfc2217: improve tests and fix bugs
Diffstat (limited to 'test')
-rw-r--r--test/test_rfc2217.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_rfc2217.py b/test/test_rfc2217.py
index 05bee83..7fd9a6e 100644
--- a/test/test_rfc2217.py
+++ b/test/test_rfc2217.py
@@ -20,6 +20,16 @@ class Test_RFC2217(unittest.TestCase):
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)
+ s.close() # no errors expected
+ # invalid address
+ s = serial.serial_for_url('rfc2217://127goingtofail', do_not_open=True)
+ self.failUnlessRaises(serial.SerialException, s.open)
+ self.assertFalse(s.is_open)
+ s.close() # no errors expected
+ # close w/o open is also OK
+ s = serial.serial_for_url('rfc2217://irrelevant', do_not_open=True)
+ self.assertFalse(s.is_open)
+ s.close() # no errors expected
if __name__ == '__main__':