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()
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))
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()
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)
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)
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)
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)
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))