def test_get_bins_y(): """ Tests that the _get_bins function returns the correct value when there is no bin specifier. """ svl_plot = { "type": "histogram", "data": "bigfoot", "y": {"field": "temperature_mid"}, } truth = {"autobiny": True} answer = _get_bins(svl_plot) assert truth == answer
def test_get_bins_bins_x(): """ Tests that the _get_bins function returns the correct value when there is a "bins" bin specifier. """ svl_plot = { "type": "histogram", "data": "bigfoot", "x": {"field": "temperature_mid"}, "bins": 50, } truth = {"nbinsx": 50} answer = _get_bins(svl_plot) assert truth == answer
def test_get_bins_step_y(): """ Tests that the _get_bins function returns the correct value when there is a step bin specifier. """ svl_plot = { "type": "histogram", "data": "bigfoot", "y": {"field": "temperature_low"}, "step": 5, } truth = {"ybins": {"size": 5}} answer = _get_bins(svl_plot) assert truth == answer