def test_start(self): profile = ProfilingRecord().start() self.assertIsNotNone(profile.start_ts) self.assertIsNone(profile.end_ts) self.assertIsNone(profile.duration) # now check again to see that end and duration are cleared profile.end_ts = datetime.datetime.utcnow() profile.duration = 1 profile.start() self.assertIsNotNone(profile.start_ts) self.assertIsNone(profile.end_ts) self.assertIsNone(profile.duration)