'When no samples have been collected, the rate is 0.'

def test_rate_is_zero_when_no_samples(self):

    r = RateMeasurer()
    self.assertEqual(r.rate(), 0, 'Expected    initial    rate    to    be    zero')
