testing/mozbase/manifestdestiny/tests/test_default_skipif.py

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial