def test_vl_spec_for_color_changes():
    color = api.Color('foobar', type='O', aggregate='avg', timeUnit='minutes', bin=api.Bin(), scale=api.ColorScale(),
                      legend=False, value='Dark2', opacity=0.5)
    assert color.name == 'foobar'
    assert color.type == 'O'
    assert color.aggregate == 'avg'
    assert color.timeUnit == 'minutes'
    assert color.bin.to_dict() == api.Bin().to_dict()
    assert color.scale.to_dict() == api.ColorScale().to_dict()
    assert color.legend == False
    assert color.value == 'Dark2'
    assert color.opacity == 0.5

    color.shorthand = 'sum(foobar):Q'
    assert color.name == 'foobar'
    assert color.type == 'Q'
    assert color.aggregate == 'sum'
    assert color.timeUnit == 'minutes'
    assert color.bin.to_dict() == api.Bin().to_dict()
    assert color.scale.to_dict() == api.ColorScale().to_dict()
    assert color.legend == False
    assert color.value == 'Dark2'
    assert color.opacity == 0.5
Check that changes are possible and sticky
dataset/ETHPy150Open ellisonbg/altair/altair/tests/test_api.py/test_vl_spec_for_color_changes