| Index: tools/perf/core/perf_data_generator_unittest.py
|
| diff --git a/tools/perf/core/perf_data_generator_unittest.py b/tools/perf/core/perf_data_generator_unittest.py
|
| index 6240d16085cece36895eab0cafc77a3115609ab2..786e3fe332ebac63d48b4edc575e4bb8da73b462 100644
|
| --- a/tools/perf/core/perf_data_generator_unittest.py
|
| +++ b/tools/perf/core/perf_data_generator_unittest.py
|
| @@ -275,3 +275,30 @@ class PerfDataGeneratorTest(unittest.TestCase):
|
| 'build1-b1': ['test'],
|
| 'build2-b1': ['other_test', 'test'],
|
| }))
|
| +
|
| + def testExtraTestsAreLoadedFromFile(self):
|
| + tests = {
|
| + 'Linux Perf': {}
|
| + }
|
| +
|
| + mock_extras_json = '''
|
| + {
|
| + "comment": [ "This is comment and therefore should be skipped." ],
|
| + "Mojo Linux Perf": {}
|
| + }
|
| + '''
|
| +
|
| + mock_waterfall_name = 'hello'
|
| +
|
| + def mockIsFile(path):
|
| + return path.endswith('%s.extras.json' % mock_waterfall_name)
|
| +
|
| + with mock.patch('os.path.isfile', side_effect=mockIsFile):
|
| + with mock.patch('__builtin__.open',
|
| + mock.mock_open(read_data=mock_extras_json)):
|
| + perf_data_generator.append_extra_tests({'name': mock_waterfall_name},
|
| + tests)
|
| +
|
| + self.assertTrue('Linux Perf' in tests)
|
| + self.assertTrue('Mojo Linux Perf' in tests)
|
| + self.assertFalse('comment' in tests)
|
|
|