mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 968321 - Make manifestparser keep track of DEFAULTS in manifests with no tests. r=jmaher
This commit is contained in:
parent
9645366154
commit
1588549f0f
@ -400,6 +400,7 @@ class ManifestParser(object):
|
||||
def __init__(self, manifests=(), defaults=None, strict=True):
|
||||
self._defaults = defaults or {}
|
||||
self.tests = []
|
||||
self.manifest_defaults = {}
|
||||
self.strict = strict
|
||||
self.rootdir = None
|
||||
self.relativeRoot = None
|
||||
@ -433,6 +434,7 @@ class ManifestParser(object):
|
||||
|
||||
# read the configuration
|
||||
sections = read_ini(fp=fp, variables=defaults, strict=self.strict)
|
||||
self.manifest_defaults[filename] = defaults
|
||||
|
||||
# get the tests
|
||||
for section, data in sections:
|
||||
@ -514,7 +516,6 @@ class ManifestParser(object):
|
||||
|
||||
# process each file
|
||||
for filename in filenames:
|
||||
|
||||
# set the per file defaults
|
||||
defaults = _defaults.copy()
|
||||
here = None
|
||||
|
2
testing/mozbase/manifestdestiny/tests/just-defaults.ini
Normal file
2
testing/mozbase/manifestdestiny/tests/just-defaults.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[DEFAULT]
|
||||
foo = bar
|
@ -190,5 +190,15 @@ class TestManifestParser(unittest.TestCase):
|
||||
missing = manifest.verifyDirectory(directory, extensions=('.js',))
|
||||
self.assertEqual(missing, (set([missing_test]), set()))
|
||||
|
||||
def test_just_defaults(self):
|
||||
"""Ensure a manifest with just a DEFAULT section exposes that data."""
|
||||
|
||||
parser = ManifestParser()
|
||||
manifest = os.path.join(here, 'just-defaults.ini')
|
||||
parser.read(manifest)
|
||||
self.assertEqual(len(parser.tests), 0)
|
||||
self.assertTrue(manifest in parser.manifest_defaults)
|
||||
self.assertEquals(parser.manifest_defaults[manifest]['foo'], 'bar')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user