def test_from_utmb(self): session = Session.from_utmb('93487880.42.10.1347552475') self.assertEqual(session.start_time, datetime.datetime.fromtimestamp(float('1347552475'))) self.assertEqual(session.track_count, 42)
def test_millisecond_timestamp(self): session = Session.from_utmb('93487880.42.10.1347552475123') self.assertEqual(session.start_time, datetime.datetime.fromtimestamp(float('1347552475.123')))
def test_generate_session_id(self): s = Session() id = s.generate_session_id() self.assertGreaterEqual(id, 0) self.assertLessEqual(id, 0x7fffffff)