예제 #1
0
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
예제 #2
0
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
예제 #3
0
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