Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dorisjlee committed Mar 22, 2021
1 parent f9d6b59 commit d9d39c2
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions tests/test_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,10 @@ def test_colored_bar_chart(global_var):
def test_bar_uniform():
df = pd.read_csv("lux/data/car.csv")
df["Year"] = pd.to_datetime(df["Year"], format="%Y")
df["Units"] = "units"
vis = Vis(["Units"], df)
df["Type"] = "A"
vis = Vis(["Type"], df)
vis_code = vis.to_Altair()
assert (
"y = alt.Y('Units', type= 'nominal', axis=alt.Axis(labelOverlap=True, title='Units'))"
in vis_code
)

assert ("y = alt.Y('Type', type= 'nominal'" in vis_code)

def test_scatter_chart(global_var):
df = pytest.car_df
Expand Down Expand Up @@ -373,16 +369,13 @@ def test_histogram_chart(global_var):
assert "ax.set_ylabel('Number of Records')" in vis_code


def test_uniform_histogram():
def test_histogram_uniform():
df = pd.read_csv("lux/data/car.csv")
df["Year"] = pd.to_datetime(df["Year"], format="%Y")
df["Units"] = 4.0
vis = Vis(["Units"], df)
vis_code = vis.to_Altair()
assert (
"y = alt.Y('Units', type= 'nominal', axis=alt.Axis(labelOverlap=True, title='Units'), sort ='-x'),"
in vis_code
)
assert ("y = alt.Y('Units', type= 'nominal'" in vis_code)


def test_heatmap_chart(global_var):
Expand Down

0 comments on commit d9d39c2

Please sign in to comment.