def test_encode_column(): from gviz_data_table.column import Column schema = Column(id='age', type=int) js = encode(schema) python = json.loads(js) assert python == {"type": "number", "id": "age", "label": "age"}
def test_validate_label(): col = Column(**minimal_schema.copy()) with pytest.raises(ValueError): col.label = 4
def test_invalid_options(): col = Column(**minimal_schema.copy()) assert col.options is None with pytest.raises(ValueError): col.options = "Age"
def test_validate_type(): col = Column(**minimal_schema.copy()) with pytest.raises(ValueError): col.type = dict