Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinyue-Yang committed Nov 20, 2024
2 parents 30521cc + 31f7b9e commit bc10d61
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions packages/schema_wrapper/test/test_generated_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,21 @@ def test_weather_plot():
rRange = [2, 10],
width = 800
)
print(to_dict(plot_spec))
assert({'colorDomain': '$domain',
'colorRange': '$colors',
'plot': [
{'data': {'filterBy': '$click', 'from': 'weather'},
'fill': 'weather',
'mark': 'dot',
'r': 'precipitation',
'x': {'dateMonthDay': 'date'},
'y': 'temp_max'}
],
'rDomain': 'Fixed',
'rRange': [2, 10],
'width': 800,
'xTickFormat': '%b',
'xyDomain': 'Fixed'} == to_dict(plot_spec))

def test_stock_plot():
plot_spec = Plot(
Expand All @@ -141,12 +155,14 @@ def test_stock_plot():
width = 680,
height = 200
)
assert to_dict(plot_spec) == {
'height': 200,
'plot': [{'data': {'from': 'aapl'}, 'mark': 'lineY', 'x': 'Date', 'y': 'Close'}],
'width': 680
}

assert({'height': 200,
'plot': [
{'data': {'from': 'aapl'},
'mark': 'lineY',
'x': 'Date',
'y': 'Close'}
],
'width': 680} == to_dict(plot_spec))

if __name__ == '__main__':
pytest.main([__file__])
Expand Down

0 comments on commit bc10d61

Please sign in to comment.