예제 #1
0
    def test_no_constraints(self):
        get_current_ami_m = self.mocker.replace(get_current_ami)
        get_current_ami_m(region="us-east-1")
        self.mocker.result(succeed("ami-giggle"))
        self.mocker.replay()

        d = get_image_id({}, {})
        d.addCallback(self.assertEquals, "ami-giggle")
        return d
예제 #2
0
    def test_default_series(self):
        get_current_ami_m = self.mocker.replace(get_current_ami)
        get_current_ami_m(region="us-east-1", ubuntu_release="puissant")
        self.mocker.result(succeed("ami-pickle"))
        self.mocker.replay()

        d = get_image_id({"default-series": "puissant"}, {})
        d.addCallback(self.assertEquals, "ami-pickle")
        return d
예제 #3
0
파일: test_utils.py 프로젝트: mcclurmc/juju
    def test_default_series(self):
        get_current_ami_m = self.mocker.replace(get_current_ami)
        get_current_ami_m(region="us-east-1", ubuntu_release="puissant")
        self.mocker.result(succeed("ami-pickle"))
        self.mocker.replay()

        d = get_image_id({"default-series": "puissant"}, {})
        d.addCallback(self.assertEquals, "ami-pickle")
        return d
예제 #4
0
파일: test_utils.py 프로젝트: mcclurmc/juju
    def test_no_constraints(self):
        get_current_ami_m = self.mocker.replace(get_current_ami)
        get_current_ami_m(region="us-east-1")
        self.mocker.result(succeed("ami-giggle"))
        self.mocker.replay()

        d = get_image_id({}, {})
        d.addCallback(self.assertEquals, "ami-giggle")
        return d
예제 #5
0
파일: test_utils.py 프로젝트: mcclurmc/juju
    def test_uses_constraints(self):
        get_current_ami_m = self.mocker.replace(get_current_ami)
        get_current_ami_m(ubuntu_release="serendipitous", architecture="x512",
                          daily=False, persistent_storage=True,
                          region="blah-north-6")
        self.mocker.result(succeed("ami-tinkle"))
        self.mocker.replay()

        constraints = {
            "architecture": "x512",
            "ubuntu_release": "serendipitous",
            "persistent_storage": True,
            "daily": False}
        d = get_image_id(
            {"region": "blah-north-6", "default-series": "overridden"},
            constraints)
        d.addCallback(self.assertEquals, "ami-tinkle")
        return d
예제 #6
0
    def test_uses_constraints(self):
        get_current_ami_m = self.mocker.replace(get_current_ami)
        get_current_ami_m(ubuntu_release="serendipitous",
                          architecture="x512",
                          daily=False,
                          persistent_storage=True,
                          region="blah-north-6")
        self.mocker.result(succeed("ami-tinkle"))
        self.mocker.replay()

        constraints = {
            "architecture": "x512",
            "ubuntu_release": "serendipitous",
            "persistent_storage": True,
            "daily": False
        }
        d = get_image_id(
            {
                "region": "blah-north-6",
                "default-series": "overridden"
            }, constraints)
        d.addCallback(self.assertEquals, "ami-tinkle")
        return d
예제 #7
0
 def test_default_image_id(self):
     d = get_image_id({"default-image-id": "ami-burble"}, {})
     d.addCallback(self.assertEquals, "ami-burble")
     return d
예제 #8
0
파일: test_utils.py 프로젝트: mcclurmc/juju
 def test_default_image_id(self):
     d = get_image_id({"default-image-id": "ami-burble"}, {})
     d.addCallback(self.assertEquals, "ami-burble")
     return d