def test_select_merge_components_random(self):
    ''' Verify that under random choices, we select among 3 components
          equally often
    '''
    MT = MergeTracker(3)
    MSelector = MergePairSelector()
    counts = np.zeros(3)
    for trial in range(1000):
      kA, kB = MSelector.select_merge_components(None, None, MT, mergename='random')
      counts[kA] += 1
      counts[kB] += 1
    counts /= np.sum(counts)
    minFrac = 0.25
    maxFrac = 0.4
    # Uniform at random means fraction of choice should be ~1/3 for each
    assert np.all(counts > minFrac)
    assert np.all(counts < maxFrac)
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/tests/merge/TestMergePairSelector.py/TestMergePairSelector.test_select_merge_components_random/original