Bug 992139 - [mozversion] Enhance mozversion to return application_display_name. r=hskupin

This commit is contained in:
Cosmin Malutan 2014-04-23 10:16:02 +02:00
parent b35e578978
commit 417486e5ea
2 changed files with 6 additions and 2 deletions

View File

@ -43,7 +43,7 @@ class Version(mozlog.LoggingMixin):
config_file = os.path.join(config_path, '%s.ini' % filename)
if os.path.exists(config_file):
config.read(config_file)
name_map = {'CodeName': 'code_name',
name_map = {'CodeName': 'display_name',
'SourceRepository': 'repository',
'SourceStamp': 'changeset'}
for key in ('BuildID', 'Name', 'CodeName', 'Version',
@ -51,6 +51,10 @@ class Version(mozlog.LoggingMixin):
name = name_map.get(key, key).lower()
self._info['%s_%s' % (filename, name)] = config.has_option(
section, key) and config.get(section, key) or None
if not self._info.get('application_display_name'):
self._info['application_display_name'] = \
self._info.get('application_name')
else:
self.warn('Unable to find %s' % config_file)

View File

@ -69,7 +69,7 @@ SourceRepository = PlatformSourceRepo
def _check_version(self, version):
self.assertEqual(version.get('application_name'), 'AppName')
self.assertEqual(version.get('application_code_name'), 'AppCodeName')
self.assertEqual(version.get('application_display_name'), 'AppCodeName')
self.assertEqual(version.get('application_version'), 'AppVersion')
self.assertEqual(version.get('application_buildid'), 'AppBuildID')
self.assertEqual(