示例#1
0
    def test_add_revision(self, kms, dynamo, tables, db_factory):
        db = MagicMock(spec=FlotillaClientDynamo)
        db_factory.return_value = db
        mock_input = self.generate_tar({"test.env": self.env_file({"DOCKER_IMAGE": "redis"})})
        add_revision(ENVIRONMENT, REGIONS, SERVICE, LABEL, (), 0, mock_input)

        self.assertEquals(kms.call_count, len(REGIONS))
        db.add_revision.assert_called_with(SERVICE, ANY)
        db.configure_service.assert_not_called()
示例#2
0
    def test_add_revision(self, kms, dynamo, tables):
        mock_input = self.generate_tar({
            'test.env': self.env_file({
                'DOCKER_IMAGE': 'redis'
            })
        })
        add_revision(ENVIRONMENT, REGIONS, SERVICE, LABEL, mock_input)

        self.assertEquals(kms.call_count, len(REGIONS))
示例#3
0
    def test_add_revision(self, kms, dynamo, tables, db_factory):
        db = MagicMock(spec=FlotillaClientDynamo)
        db_factory.return_value = db
        mock_input = self.generate_tar(
            {'test.env': self.env_file({'DOCKER_IMAGE': 'redis'})})
        add_revision(ENVIRONMENT, REGIONS, SERVICE, LABEL, (), 0, mock_input)

        self.assertEquals(kms.call_count, len(REGIONS))
        db.add_revision.assert_called_with(SERVICE, ANY)
        db.configure_service.assert_not_called()
示例#4
0
    def test_add_revision_service_update(self, kms, dynamo, tables, db_factory):
        db = MagicMock(spec=FlotillaClientDynamo)
        db_factory.return_value = db

        mock_input = self.generate_tar(
            {"test.env": self.env_file({"DOCKER_IMAGE": "redis", "INSTANCE_TYPE": "t2.nano"})}
        )
        add_revision(ENVIRONMENT, REGIONS, SERVICE, LABEL, (), 0, mock_input)

        db.configure_service.assert_called_with(SERVICE, ANY)
示例#5
0
    def test_add_revision_service_update(self, kms, dynamo, tables,
                                         db_factory):
        db = MagicMock(spec=FlotillaClientDynamo)
        db_factory.return_value = db

        mock_input = self.generate_tar({
            'test.env':
            self.env_file({
                'DOCKER_IMAGE': 'redis',
                'INSTANCE_TYPE': 't2.nano'
            })
        })
        add_revision(ENVIRONMENT, REGIONS, SERVICE, LABEL, (), 0, mock_input)

        db.configure_service.assert_called_with(SERVICE, ANY)
示例#6
0
    def test_add_revision_highlander(self, kms, dynamo, tables, wait_for):
        mock_input = self.generate_tar(
            {'test.env': self.env_file({'DOCKER_IMAGE': 'redis'})})
        add_revision(ENVIRONMENT, REGIONS, SERVICE, LABEL, (), 30, mock_input)

        wait_for.assert_called_with(ANY, ANY, ANY, ANY, 30)
示例#7
0
    def test_add_revision_highlander(self, kms, dynamo, tables, wait_for):
        mock_input = self.generate_tar({"test.env": self.env_file({"DOCKER_IMAGE": "redis"})})
        add_revision(ENVIRONMENT, REGIONS, SERVICE, LABEL, (), 30, mock_input)

        wait_for.assert_called_with(ANY, ANY, ANY, ANY, 30)
示例#8
0
    def test_add_revision(self, kms, dynamo, tables):
        mock_input = self.generate_tar(
            {'test.env': self.env_file({'DOCKER_IMAGE': 'redis'})})
        add_revision(ENVIRONMENT, REGIONS, SERVICE, LABEL, mock_input)

        self.assertEquals(kms.call_count, len(REGIONS))