diff options
author | Javi Merino <javi.merino@arm.com> | 2015-06-15 16:45:38 +0100 |
---|---|---|
committer | Javi Merino <javi.merino@arm.com> | 2015-08-13 18:59:56 +0100 |
commit | 96f2b845e1564e3e81930f2109dc9d1562882cb2 (patch) | |
tree | 5d919e7c1a98b9a449172324b5c7a383f71157df /tests | |
parent | adcfc8e5411a86ef07237def83efbb8d652a5fe4 (diff) | |
download | trappy-96f2b845e1564e3e81930f2109dc9d1562882cb2.tar.gz |
sysfs_extractor: don't barf if it's not a WA output directory with sysfs_extractor info
Change-Id: I3333e0eda01a94eac25f8441c6a672787423dcb3
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_wa_sysfs_extractor.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_wa_sysfs_extractor.py b/tests/test_wa_sysfs_extractor.py index 7f2f12a..2d7a54e 100644 --- a/tests/test_wa_sysfs_extractor.py +++ b/tests/test_wa_sysfs_extractor.py @@ -15,6 +15,7 @@ import os import subprocess +import unittest import utils_tests @@ -46,3 +47,14 @@ class TestWASysfsExtractor(utils_tests.SetupDirectory): """Test that printing the thermal params doesn't bomb""" cr2.wa.SysfsExtractor(".").pretty_print_in_ipython() + +class TestWASysfsExtractorFailMode(unittest.TestCase): + """Test the failure modes of the Workload Automation sysfs extractor""" + + def test_get_params_invalid_directory(self): + """An invalid directory for cr2.wa.SysfsExtractor doesn't bomb""" + + sysfs_extractor = cr2.wa.SysfsExtractor(".") + self.assertEquals(sysfs_extractor.get_parameters(), {}) + + sysfs_extractor.pretty_print_in_ipython() |