aboutsummaryrefslogtreecommitdiff
path: root/tests/test_stats_grammar.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_stats_grammar.py')
-rw-r--r--tests/test_stats_grammar.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_stats_grammar.py b/tests/test_stats_grammar.py
index de62f21..5138efc 100644
--- a/tests/test_stats_grammar.py
+++ b/tests/test_stats_grammar.py
@@ -244,3 +244,13 @@ trappy.thermal.Thermal:temp"
prs = Parser(trace, filters={"cdev_state": 3})
dfr_res = prs.solve("devfreq_out_power:freq")
self.assertEquals(len(dfr_res), 1)
+
+ def test_no_events(self):
+ """Test trying to parse absent data"""
+ trace = trappy.FTrace()
+ prs = Parser(trace)
+
+ # cpu_frequency is an event we know how to parse, but it isn't present
+ # in the test trace.
+ self.assertRaisesRegexp(ValueError, "No events found for cpu_frequency",
+ prs.solve, "cpu_frequency:frequency")