def test_create_from_log_msg_with_stamp(self): seconds_since_epoch = 100 msg = Log() msg.stamp = Time(sec=seconds_since_epoch, nanosec=0) msg.level = int.from_bytes(Log.DEBUG, sys.byteorder) entry = Entry.from_ros_msg(msg, use_current_time=False) self.assertEqual(entry.date_time.toSecsSinceEpoch(), seconds_since_epoch)
def test_create_from_log_msg_with_stamp(self): seconds_since_epoch = 100 msg = Log() msg.header.stamp = rospy.Time(secs=seconds_since_epoch, nsecs=0) msg.level = Log.DEBUG entry = Entry.from_ros_msg(msg) self.assertEqual(entry.date_time.toSecsSinceEpoch(), seconds_since_epoch)
def test_create_from_info_log_msg(self): content = "test" msg = Log() msg.msg = content msg.level = int.from_bytes(Log.INFO, sys.byteorder) entry = Entry.from_ros_msg(msg) self.assertEqual(entry.content, content) self.assertFalse(entry.is_error) self.assertAlmostEqual(entry.date_time.toSecsSinceEpoch(), QDateTime.currentSecsSinceEpoch(), 10)
def test_create_from_fatal_log_msg(self): msg = Log() msg.level = int.from_bytes(Log.FATAL, sys.byteorder) entry = Entry.from_ros_msg(msg) self.assertTrue(entry.is_error)
def test_create_from_fatal_log_msg(self): msg = Log() msg.level = Log.FATAL entry = Entry.from_ros_msg(msg) self.assertTrue(entry.is_error)
def test_create_from_error_log_msg(self): msg = Log() msg.level = Log.ERROR entry = Entry.from_ros_msg(msg) self.assertTrue(entry.is_error)