Skip to content

Commit

Permalink
Modify histogram code test case
Browse files Browse the repository at this point in the history
  • Loading branch information
micahtyong committed Mar 13, 2021
1 parent 1c1e629 commit 86eaac2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/test_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import pandas as pd
from lux.vis.VisList import VisList
from lux.vis.Vis import Vis
from lux.vislib.altair.Histogram import compute_bin_width


def test_vis(global_var):
Expand Down Expand Up @@ -341,11 +340,9 @@ def test_histogram_chart(global_var):
lux.config.plotting_backend = "vegalite"
vis = Vis(["Displacement"], df)
vis_code = vis.to_Altair()
expected_bin_size = compute_bin_width(vis.data["Displacement"])
assert "alt.Chart(visData).mark_bar" in vis_code
assert str(expected_bin_size) in vis_code
assert (
"alt.X('Displacement', title='Displacement (binned)',bin=alt.Bin(binned=True), type='quantitative', axis=alt.Axis(labelOverlap=True, title='Displacement (binned)'), scale=alt.Scale(domain=(68.0, 455.0)))"
"alt.X('Displacement', title='Displacement (binned)',bin=alt.Bin(binned=True, step=38.7), type='quantitative', axis=alt.Axis(labelOverlap=True, title='Displacement (binned)'), scale=alt.Scale(domain=(68.0, 455.0)))"
in vis_code
)
assert 'alt.Y("Number of Records", type="quantitative")' in vis_code
Expand Down

0 comments on commit 86eaac2

Please sign in to comment.