MCPcopy Create free account
hub / github.com/spotify/chartify / test_single_datetime_line

Method test_single_datetime_line

tests/test_plots.py:87–98  ·  view source on GitHub ↗

Single line test

(self)

Source from the content-addressed store, hash-verified

85 assert np.array_equal(chart_data(ch, "b")["number2"], [4, -3, -10])
86
87 def test_single_datetime_line(self):
88 """Single line test"""
89 data = pd.DataFrame(
90 {
91 "number": [1, 10, -10, 0],
92 "datetimes": ["2017-01-01", "2017-01-02", "2017-01-03", "2017-01-04"],
93 }
94 )
95 ch = chartify.Chart(x_axis_type="datetime")
96 ch.plot.line(data, x_column="datetimes", y_column="number")
97 assert np.array_equal(chart_data(ch, "")["datetimes"], pd.date_range("2017-01-01", "2017-01-04"))
98 assert np.array_equal(chart_data(ch, "")["number"], [1, 10, -10, 0])
99
100
101class TestScatter:

Callers

nothing calls this directly

Calls 2

chart_dataFunction · 0.85
lineMethod · 0.45

Tested by

no test coverage detected