def test_merge(self): counter = CounterAggregator() counter2 = CounterAggregator() counter.checkpoint = 1.0 counter2.checkpoint = 3.0 counter.merge(counter2) self.assertEqual(counter.checkpoint, 4.0)
def test_merge(self): counter = CounterAggregator() counter2 = CounterAggregator() counter.checkpoint = 1.0 counter2.checkpoint = 3.0 counter2.last_update_timestamp = 123 counter.merge(counter2) self.assertEqual(counter.checkpoint, 4.0) self.assertEqual(counter.last_update_timestamp, 123)