

def testTwoElementDistribution(self):
    dist = {
        1: 50.0,
        10: 50.0,
    }
    iter = object_storage_api_tests.SizeDistributionIterator(dist)
    with mock.patch((random.__name__ + '.random')) as rand:
        rand.side_effect = [0.2, 0.7, 0.2]
        values = list(itertools.islice(iter, 3))
        self.assertTrue((iter == [1, 10, 1]))

dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/script-tests/object_storage_worker_tests.py TestSizeDistributionIterator.testTwoElementDistribution/VarMisuse@84/102 `values`->`iter`