diff options
author | Chris Liechti <cliechti@gmx.net> | 2015-10-31 23:31:26 +0100 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2015-10-31 23:31:26 +0100 |
commit | bb5341b6f19e68ae59b7cccf83d4b363f10330bf (patch) | |
tree | 316045cf0cf6046aff04a12fccfa98c416a79f6d /test | |
parent | 3fcb192384b2b07a39aa3dcb5f89a8194fd613da (diff) | |
download | pyserial-git-bb5341b6f19e68ae59b7cccf83d4b363f10330bf.tar.gz |
rfc2217: improve tests and fix bugs
Diffstat (limited to 'test')
-rw-r--r-- | test/test_rfc2217.py | 10 |
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__': |