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

Method test_single_datetime_text

tests/test_plots.py:174–187  ·  view source on GitHub ↗

Single line test

(self)

Source from the content-addressed store, hash-verified

172 assert np.array_equal(chart_data(ch, "b")["text"], ["b", "b", "b"])
173
174 def test_single_datetime_text(self):
175 """Single line test"""
176 data = pd.DataFrame(
177 {
178 "number": [1, 10, -10, 0],
179 "datetimes": ["2017-01-01", "2017-01-02", "2017-01-03", "2017-01-04"],
180 "text": ["a", "b", "a", "b"],
181 }
182 )
183 ch = chartify.Chart(x_axis_type="datetime")
184 ch.plot.text(data, x_column="datetimes", y_column="number", text_column="text")
185 assert np.array_equal(chart_data(ch, "")["datetimes"], pd.date_range("2017-01-01", "2017-01-04"))
186 assert np.array_equal(chart_data(ch, "")["number"], [1, 10, -10, 0])
187 assert np.array_equal(chart_data(ch, "")["text"], ["a", "b", "a", "b"])
188
189
190class CategoricalTextTest:

Callers

nothing calls this directly

Calls 2

chart_dataFunction · 0.85
textMethod · 0.45

Tested by

no test coverage detected