From 70bf90432545b0583dde309aea507fa773f2d143 Mon Sep 17 00:00:00 2001 From: cliechti Date: Sat, 19 Mar 2011 00:22:32 +0000 Subject: related to SF 3093882, raise an exception when open() is called twice, also add unit test for this git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@392 f19166aa-fa4f-0410-85c2-fa1106f25c8a --- test/test_advanced.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/test_advanced.py b/test/test_advanced.py index 6c45006..0d85e2a 100644 --- a/test/test_advanced.py +++ b/test/test_advanced.py @@ -67,6 +67,13 @@ class Test_ChangeAttributes(unittest.TestCase): self.failUnlessEqual(self.s.port, 1) self.failUnlessEqual(self.s.portstr, serial.device(1)) + def test_DoubleOpen(self): + self.s.port = PORT + self.s.open() + # calling open for a second time is an error + self.failUnlessRaises(serial.SerialException, self.s.open) + + def test_BaudrateSetting(self): self.s.port = PORT self.s.open() -- cgit v1.2.1