44 from rospy.exceptions
import ROSException, ROSSerializationException, ROSInternalException, ROSInitException, \
45 TransportException, TransportTerminated, TransportInitError
47 for e
in [ROSException, ROSInitException, ROSSerializationException]:
49 self.assert_(isinstance(exc, ROSException))
50 for e
in [ROSInternalException,
51 TransportException, TransportTerminated, TransportInitError]:
53 self.assert_(isinstance(exc, ROSInternalException))
56 from rospy.exceptions
import ROSInterruptException, ROSException
58 raise ROSInterruptException(
"test")
62 raise ROSInterruptException(
"test")
63 except KeyboardInterrupt:
67 from rospy.exceptions
import ROSTimeMovedBackwardsException, ROSInterruptException
69 raise ROSTimeMovedBackwardsException(1.0)
70 except ROSInterruptException
as e:
72 self.assertEqual(
"ROS time moved backwards", e.message)
75 raise ROSTimeMovedBackwardsException(time)
76 except ROSTimeMovedBackwardsException
as e:
77 self.assertEqual(time, e.time)
def test_ROSTimeMovedBackwardsException(self)
def test_ROSInterruptException(self)
def test_exceptions(self)