예제 #1
0
def test_plot_geom_scale():
    geom = _geom('geom')
    scale = _scale('A')
    plot = gg.ggplot()

    expect = {
        'kind': 'plot',
        'data': None,
        'mapping': None,
        'layers': [geom.as_dict()],
        'scales': [scale.as_dict()]
    }

    assert (plot + geom + scale).as_dict() == expect
    assert (plot + scale + geom).as_dict() == expect
    assert (plot + (scale + geom)).as_dict() == expect
예제 #2
0
def test_scale(args_list, args_dict, expected):
    spec = _scale(*args_list, **args_dict)
    assert spec.as_dict() == expected