def test_vl_spec_for_x_y_changes():
    for x in [api.X('foobar:O', type='N', aggregate='median', timeUnit='seconds', bin=api.Bin(), scale = api.Scale(),
                    axis=api.Axis(), band=api.Band(), sort=[api.SortItems()]),
              api.Y('foobar:O', type='N', aggregate='median', timeUnit='seconds', bin=api.Bin(), scale = api.Scale(),
                    axis=api.Axis(), band=api.Band(), sort=[api.SortItems()])]:
        assert x.name == 'foobar'
        assert x.type == 'N'
        assert x.aggregate == 'median'
        assert x.timeUnit == 'seconds'
        assert x.bin.to_dict() == api.Bin().to_dict()
        assert x.scale.to_dict() == api.Scale().to_dict()
        assert x.axis.to_dict() == api.Axis().to_dict()
        assert x.band.to_dict() == api.Band().to_dict()
        assert x.sort[0].to_dict() == api.SortItems().to_dict()

        x.shorthand = 'sum(foobar):Q'
        assert x.name == 'foobar'
        assert x.type == 'Q'
        assert x.aggregate == 'sum'
        assert x.timeUnit == 'seconds'
        assert x.bin.to_dict() == api.Bin().to_dict()
        assert x.scale.to_dict() == api.Scale().to_dict()
        assert x.axis.to_dict() == api.Axis().to_dict()
        assert x.band.to_dict() == api.Band().to_dict()
        assert x.sort[0].to_dict() == api.SortItems().to_dict()
Check that changes are possible and sticky
dataset/ETHPy150Open ellisonbg/altair/altair/tests/test_api.py/test_vl_spec_for_x_y_changes