• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/python
2"""
3This is not meant to be executed unless copied into a
4scenario package and renamed with a _unittest suffix.
5"""
6
7import os, unittest
8from os import path
9import common
10from autotest_lib.tko.parsers.test import scenario_base
11
12GOLDEN = 'golden'
13
14
15class ParserScenerioTestCase(scenario_base.BaseScenarioTestCase):
16    def test_regression(self):
17        """We want to ensure that result matches the golden.
18
19        This test is enabled if there is a golden entry
20        in the parser_result_store.
21        """
22        self.skipIf(
23            GOLDEN not in self.parser_result_store,
24            'No golden data to test against')
25
26        golden = self.parser_result_store[GOLDEN]
27        fresh_parser_result = self.harness.execute()
28        fresh_copy = scenario_base.copy_parser_result(
29            fresh_parser_result)
30        self.assertEquals(golden, fresh_copy)
31
32
33if __name__ == '__main__':
34    unittest.main()
35