def test_merge_last_updated_none(self): observer1 = LastValueAggregator() observer2 = LastValueAggregator() observer1.checkpoint = 23 observer2.checkpoint = 47 observer1.last_update_timestamp = 0 observer2.last_update_timestamp = 100 observer1.merge(observer2) self.assertEqual(observer1.checkpoint, 47) self.assertEqual(observer1.last_update_timestamp, 100)
def test_merge_with_empty(self): observer1 = LastValueAggregator() observer2 = LastValueAggregator() observer1.checkpoint = 23 observer1.last_update_timestamp = 100 observer1.merge(observer2) self.assertEqual(observer1.checkpoint, 23) self.assertEqual(observer1.last_update_timestamp, 100)