def METHOD_NAME(
    self, cognite_client: CogniteClient, integration_test_space: Space, monkeypatch: Any
) -> None:
    # Arrange
    valid_space = SpaceApply(
        space="myNewValidSpace",
    )
    invalid_space = SpaceApply(space="myInvalidSpace", name="wayTooLong" * 255)
    monkeypatch.setattr(cognite_client.data_modeling.spaces, "_CREATE_LIMIT", 1)
    try:
        # Act
        with pytest.raises(CogniteAPIError) as error:
            cognite_client.data_modeling.spaces.apply([valid_space, invalid_space])
        # Assert
        assert "name size must be between 0 and 255" in error.value.message
        assert error.value.code == 400
        assert len(error.value.successful) == 1
        assert len(error.value.failed) == 1
    finally:
        # Cleanup
        cognite_client.data_modeling.spaces.delete(valid_space.as_id())