diff options
author | Javi Merino <javi.merino@arm.com> | 2016-06-30 16:30:38 +0100 |
---|---|---|
committer | Javi Merino <javi.merino@arm.com> | 2016-06-30 16:30:38 +0100 |
commit | 44745135f3c7410d144115d3b50c9591d17baab1 (patch) | |
tree | 061e56c6072664979cb16eade2885ae7e060f54e /tests | |
parent | bf2332847121d1f29afa449672adadaa448788b1 (diff) | |
download | trappy-44745135f3c7410d144115d3b50c9591d17baab1.tar.gz |
plotter: show appropriate error when plotting a dataframe but column was not specified
When you try to plot a dataframe without specifying the column, the code
that checks it fails with
KeyError: "column"
Fix the check so that the appropriate error (ValueError: Column not
specified for DataFrame input) is printed.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_plotter.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_plotter.py b/tests/test_plotter.py index a2a17f5..e2d622a 100644 --- a/tests/test_plotter.py +++ b/tests/test_plotter.py @@ -249,11 +249,15 @@ class TestPlotter(BaseTestThermal): class TestILinePlotter(unittest.TestCase): def test_simple_dfr(self): + """ILinePlot doesn't barf when plotting DataFrames""" dfr1 = pd.DataFrame([1, 2, 3, 4], columns=["a"]) dfr2 = pd.DataFrame([2, 3, 4, 5], columns=["a"]) trappy.ILinePlot([dfr1, dfr2], column=["a", "a"]).view(test=True) + with self.assertRaises(ValueError): + trappy.ILinePlot([dfr1, dfr2]).view(test=True) + def test_duplicate_merging(self): dfr1 = pd.DataFrame([1, 2, 3, 4], index=[0., 0., 1., 2.], columns=["a"]) dfr2 = pd.DataFrame([2, 3, 4, 5], index=[1., 1., 1., 2.], columns=["a"]) |