'Source AMIs, build region, and target regions can all be overridden
in a chosen template.'

def test_configuration(self):

    expected_build_region = AWS_REGIONS.EU_WEST_1
    expected_publish_regions = [AWS_REGIONS.AP_NORTHEAST_1, AWS_REGIONS.AP_SOUTHEAST_1, AWS_REGIONS.AP_SOUTHEAST_2]
    expected_source_ami_map = {AWS_REGIONS.EU_WEST_1: random_name(self)}
    intent = PackerConfigure(build_region=expected_build_region, publish_regions=expected_publish_regions, source_ami_map=expected_source_ami_map, template=u'docker')
    packer_configuration_path = sync_perform(dispatcher=RealPerformers(working_directory=self.make_temporary_directory()).dispatcher(), effect=Effect(intent=intent))
    with packer_configuration_path.open('r') as f:
        packer_configuration = json.load(f)
    [builder] = packer_configuration['builders']
    build_region = builder['region']
    build_source_ami = builder['source_ami']
    publish_regions = builder['ami_regions']
    [_provisioner] = packer_configuration['provisioners']
    self.assertEqual((expected_build_region.value, set((c.value for c in expected_publish_regions)), expected_source_ami_map[expected_build_region]), (build_region, set(publish_regions), build_source_ami))
