Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | #!/usr/bin/env python |
michael@0 | 2 | |
michael@0 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 5 | # You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 6 | |
michael@0 | 7 | import os |
michael@0 | 8 | import unittest |
michael@0 | 9 | from manifestparser import ManifestParser |
michael@0 | 10 | |
michael@0 | 11 | here = os.path.dirname(os.path.abspath(__file__)) |
michael@0 | 12 | |
michael@0 | 13 | class TestDefaultSkipif(unittest.TestCase): |
michael@0 | 14 | """test applying a skip-if condition in [DEFAULT] and || with the value for the test""" |
michael@0 | 15 | |
michael@0 | 16 | |
michael@0 | 17 | def test_defaults(self): |
michael@0 | 18 | |
michael@0 | 19 | default = os.path.join(here, 'default-skipif.ini') |
michael@0 | 20 | parser = ManifestParser(manifests=(default,)) |
michael@0 | 21 | for test in parser.tests: |
michael@0 | 22 | if test['name'] == 'test1': |
michael@0 | 23 | self.assertEqual(test['skip-if'], "(os == 'win' && debug ) || (debug)") |
michael@0 | 24 | elif test['name'] == 'test2': |
michael@0 | 25 | self.assertEqual(test['skip-if'], "(os == 'win' && debug ) || (os == 'linux')") |
michael@0 | 26 | elif test['name'] == 'test3': |
michael@0 | 27 | self.assertEqual(test['skip-if'], "(os == 'win' && debug ) || (os == 'win')") |
michael@0 | 28 | elif test['name'] == 'test4': |
michael@0 | 29 | self.assertEqual(test['skip-if'], "(os == 'win' && debug ) || (os == 'win' && debug)") |
michael@0 | 30 | elif test['name'] == 'test5': |
michael@0 | 31 | self.assertEqual(test['skip-if'], "os == 'win' && debug # a pesky comment") |
michael@0 | 32 | elif test['name'] == 'test6': |
michael@0 | 33 | self.assertEqual(test['skip-if'], "(os == 'win' && debug ) || (debug )") |
michael@0 | 34 | |
michael@0 | 35 | if __name__ == '__main__': |
michael@0 | 36 | unittest.main() |