def test_calculate_bucket_index_within_max_long(self): counter = DataflowDistributionCounter() bucket = 1 power_of_ten = 1 while power_of_ten <= INT64_MAX: for multiplier in [1, 2, 5]: value = multiplier * power_of_ten actual_bucket = counter.calculate_bucket_index(value - 1) self.assertEquals(actual_bucket, bucket - 1) bucket += 1 power_of_ten *= 10
def test_calculate_bucket_index_within_max_long(self): counter = DataflowDistributionCounter() bucket = 1 power_of_ten = 1 while power_of_ten <= INT64_MAX: for multiplier in [1, 2, 5]: value = multiplier * power_of_ten actual_bucket = counter.calculate_bucket_index(value - 1) self.assertEqual(actual_bucket, bucket - 1) bucket += 1 power_of_ten *= 10
def test_calculate_bucket_index_with_input_0(self): counter = DataflowDistributionCounter() index = counter.calculate_bucket_index(0) self.assertEquals(index, 0)
def test_calculate_bucket_index_with_input_0(self): counter = DataflowDistributionCounter() index = counter.calculate_bucket_index(0) self.assertEqual(index, 0)