def test_binning_base(): n_bins = 10 label = 'test' b = binning.Base(n_bins, label, use_everything_bin=False) assert len(b.values) == (n_bins + 2) b = binning.Base(n_bins, label, use_everything_bin=True) assert len(b.values) == (n_bins + 3)
def test_get_bin_lower_invalid(): b = binning.Base(10, 'test') pytest.raises(AttributeError, b.get_bin_lower, 0)
def test_get_bin_lower(): b = binning.Base(10, 'test') assert b.get_bin_lower('overflow') == 'overflow' assert b.get_bin_lower('underflow') == 'underflow' assert b.get_bin_lower('everything') == 'everything'
def test_find_all_bins(): b = binning.Base(10, 'test') pytest.raises(AttributeError, b.find_all_bins, 'overflow')
def test_get_bin_lower_invalid(): b = binning.Base(10, 'test') b.get_bin_lower(0)
def test_get_bin_lower(): b = binning.Base(10, 'test') assert_equal(b.get_bin_lower('overflow'), 'overflow') assert_equal(b.get_bin_lower('underflow'), 'underflow') assert_equal(b.get_bin_lower('everything'), 'everything')
def test_find_all_bins(): b = binning.Base(10, 'test') b.find_all_bins('overflow')