def test_add_multiple_files(self): builder = cef_json_builder() expected = [] platforms = cef_json_builder.get_platforms() versions = [ # Old-style version numbers. '3.2704.1414.g185cd6c', '3.2704.1400.gde36543', # New-style version numbers. '74.0.1+g62d140e+chromium-74.0.3729.6' ] types = cef_json_builder.get_distrib_types() for platform in platforms: for version in versions: for type in types: expected.append( self._add_test_file(builder, platform=platform, type=type, version=version)) self._verify_write_read(builder) # No filter. files = builder.get_files() self.assertEqual(len(files), len(platforms) * len(versions) * len(types)) # Version filter. for version in versions: files = builder.get_files(version=version) self.assertEqual(len(files), len(platforms) * len(types)) # Type filter. files = builder.get_files(type='client') self.assertEqual(len(files), len(platforms) * len(versions)) # Platform filter. files = builder.get_files(platform='windows32') self.assertEqual(len(files), len(types) * len(versions)) # All filters. idx = 0 for platform in platforms: for version in versions: for type in types: files = builder.get_files(platform=platform, type=type, version=version) self.assertEqual(len(files), 1) self.assertEqual(expected[idx], files[0]) idx += 1
def test_add_multiple_files(self): builder = cef_json_builder() expected = [] platforms = cef_json_builder.get_platforms() versions = ['3.2704.1414.g185cd6c', '3.2704.1400.gde36543'] types = cef_json_builder.get_distrib_types() for platform in platforms: for version in versions: for type in types: expected.append( self._add_test_file( builder, platform=platform, type=type, version=version)) self._verify_write_read(builder) # No filter. files = builder.get_files() self.assertEqual(len(files), len(platforms) * len(versions) * len(types)) # Version filter. files = builder.get_files(version=version) self.assertEqual(len(files), len(platforms) * len(types)) # Type filter. files = builder.get_files(type='client') self.assertEqual(len(files), len(platforms) * len(versions)) # Platform filter. files = builder.get_files(platform='windows32') self.assertEqual(len(files), len(types) * len(versions)) # All filters. idx = 0 for platform in platforms: for version in versions: for type in types: files = builder.get_files( platform=platform, type=type, version=version) self.assertEqual(len(files), 1) self.assertEqual(expected[idx], files[0]) idx = idx + 1
if platform.find('windows') == 0 or platform.find('macosx') == 0: files.append(make_fake_file_info(platform, version, 'release_symbols')) return files # Program entry point. if __name__ == '__main__': # Verify command-line arguments. if len(sys.argv) < 5 or sys.argv[1] != 'add': sys.stderr.write('Usage: %s add <platform> <cef_version> <chromium_version>' % sys.argv[0]) sys.exit() # Requested platform. if sys.argv[2] == 'all': platforms = cef_json_builder.get_platforms() elif sys.argv[2] in cef_json_builder.get_platforms(): platforms = [sys.argv[2]] else: sys.stderr.write('Invalid platform: %s' % platform) sys.exit() # Requested CEF version. cef_version = sys.argv[3] if not cef_json_builder.is_valid_version(cef_version): sys.stderr.write('Invalid CEF version: %s' % cef_version) sys.exit() # Requested Chromium version. chromium_version = sys.argv[4] if not cef_json_builder.is_valid_chromium_version(chromium_version):
return files # Program entry point. if __name__ == '__main__': # Verify command-line arguments. if len(sys.argv) < 5 or sys.argv[1] != 'add': sys.stderr.write( 'Usage: %s add <platform> <cef_version> <chromium_version>' % sys.argv[0]) sys.exit() # Requested platform. if sys.argv[2] == 'all': platforms = cef_json_builder.get_platforms() elif sys.argv[2] in cef_json_builder.get_platforms(): platforms = [sys.argv[2]] else: sys.stderr.write('Invalid platform: %s' % platform) sys.exit() # Requested CEF version. cef_version = sys.argv[3] if not cef_json_builder.is_valid_version(cef_version): sys.stderr.write('Invalid CEF version: %s' % cef_version) sys.exit() # Requested Chromium version. chromium_version = sys.argv[4] if not cef_json_builder.is_valid_chromium_version(chromium_version):