def test_one_trace(self): """should still produce a valid figure""" d = Drawable() trace = dict(type="scatter", x=[0, 1], y=[0, 1]) d.add_trace(trace) f = d.figure self.assertEqual(f.data, [trace])
def test_add_traces(self): """test trace add method""" d = Drawable() self.assertEqual(d.traces, []) trace = dict(type="scatter", x=[0, 1], y=[0, 1]) d.add_trace(trace) self.assertEqual(d.traces, [trace]) self.assertTrue(isinstance(d.traces[0], UnionDict))