Ejemplo n.º 1
0
    def test_config_override_ami_only(self):
        self.mocker.replace(get_current_ami)
        self.mocker.replay()

        constraints = yield get_constraints(["instance-type=t1.micro"])
        spec = yield get_machine_spec(
            {"default-image-id": "ami-blobble"}, constraints)
        self.assertEquals(spec.image_id, "ami-blobble")
        self.assertEquals(spec.instance_type, "t1.micro")
Ejemplo n.º 2
0
    def assert_image_id(self, config, constraints, series, arch, region, hvm,
                        instance_type, ssl_verify=False):
        get_current_ami_m = self.mocker.replace(get_current_ami)
        get_current_ami_m(series, arch, region, hvm, ssl_verify)
        self.mocker.result(succeed("ami-giggle"))
        self.mocker.replay()

        spec = yield get_machine_spec(config, constraints)
        self.assertEquals(spec.image_id, "ami-giggle")
        self.assertEquals(spec.instance_type, instance_type)