full_check_locales = options.full_check_locales

    # Variables from release config
    retry(mercurial, args=(options.buildbot_configs, 'buildbot-configs'))
    update('buildbot-configs', revision=options.release_tag)
    release_config = validate(options)
    product_name = release_config['productName']
    staging_server = FTP_SERVER_TEMPLATE % release_config['stagingServer']
    aus_server_url = release_config['ausServerUrl']
    build_number = release_config['buildNumber']
    previous_releases_staging_server = FTP_SERVER_TEMPLATE % \
        release_config.get('previousReleasesStagingServer',
                           release_config['stagingServer'])

    # Current version data
    pc = PatcherConfig(open(options.config).read())
    partials = pc['current-update']['partials'].keys()
    app_name = pc['appName']
    to_version = pc['current-update']['to']
    to_ = makeReleaseRepackUrls(product_name,
                                app_name,
                                to_version,
                                options.platform,
                                locale='%locale%',
                                signed=True,
                                exclude_secondary=True).values()[0]
    candidates_dir = makeCandidatesDir(product_name,
                                       to_version,
                                       build_number,
                                       ftp_root='/')
    to_path = "%s%s" % (candidates_dir, to_)
 def setUp(self):
     self.pc = PatcherConfig()
                        dest="updater_platform",
                        default=None)
    args = parser.parse_args()
    logging.basicConfig(format="%(message)s", level=args.loglevel)

    ftp_platform = buildbot2ftp(args.platform)
    full_check_locales = args.full_check_locales
    product_name = args.product
    stage_product_name = args.stage_product or product_name
    prev_archive_prefix = args.previous_archive_prefix or args.archive_prefix
    aus_server_url = args.balrog_url
    build_number = args.build_number
    updater_platform = args.updater_platform

    # Current version data
    pc = PatcherConfig(args.config.read())
    partials = pc['current-update']['partials'].keys()
    app_name = pc['appName']
    to_version = pc['current-update']['to']
    to_release = pc['release'][to_version]
    to_ = makeReleaseRepackUrls(product_name,
                                app_name,
                                to_version,
                                args.platform,
                                locale='%locale%',
                                signed=True,
                                exclude_secondary=True).values()[0]
    candidates_dir = makeCandidatesDir(stage_product_name,
                                       to_version,
                                       build_number,
                                       ftp_root='/')
from os import path
import unittest

import mock

from apache_conf_parser import ApacheConfParser

from release.updates.patcher import substitutePath, PatcherConfig, PatcherConfigError

samplePatcherConfigObj = PatcherConfig()
samplePatcherConfigObj['appName'] = 'Firefox'
samplePatcherConfigObj['current-update'] = {
    'channel': ['release'],
    'testchannel': ['betatest', 'releasetest'],
    'details': 'https://details',
    'from': '13.0',
    'to': '13.0.1',
    'actions': ['silent'],
    'action-locales': ['en-US'],
    'complete': {
        'betatest-url': 'http://%platform%.%locale%.complete.mar',
        'path': '%platform%.%locale%.complete.mar',
        'url': 'http://%bouncer-platform%.%locale%.complete',
    },
    'partials': {
        '12.0': {
            'betatest-url': 'http://%platform%.%locale%.12.0.partial.mar',
            'path': '%platform%.%locale%.12.0.partial.mar',
            'url': 'http://%bouncer-platform%.%locale%.12.0.partial',
        },
        '13.0': {