Skip to content

Commit 72868ff

Browse files
updated roff
1 parent b49c131 commit 72868ff

8 files changed

Lines changed: 25 additions & 27 deletions

File tree

src/sap_cloud_sdk/outputmanagement/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from pydantic import BaseModel, Field, field_validator
55
import logging
66

7+
from sap_cloud_sdk.destination import create_client, AccessStrategy
8+
79
logger = logging.getLogger(__name__)
810

911

@@ -69,15 +71,13 @@ class Config:
6971

7072
def get_destination(self):
7173
"""Retrieve the destination from SAP BTP Destination Service.
72-
Uses relative import to access sap_cloud_sdk.destination module.
74+
Uses top-level import to access sap_cloud_sdk.destination module.
7375
Returns:
7476
Destination object with URL, authentication, and properties
7577
Raises:
7678
ValueError: If destination is not found
7779
Exception: If destination retrieval fails
7880
"""
79-
from ...destination import create_client, AccessStrategy
80-
8181
# Resolve instance name: use provided value or default to "default"
8282
inst = self.instance or "default"
8383
logger.info(

src/sap_cloud_sdk/outputmanagement/user-guide.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ from sap_cloud_sdk.outputmanagement import create_client
440440

441441
try:
442442
client = create_client(destination_name="ARIBA_OUTPUT_SERVICE")
443-
443+
444444
response = client.send_email(
445445
notification_template_key="NOTIFICATION",
446446
to=["user@example.com"],
@@ -481,7 +481,7 @@ for order in orders:
481481
to=[order.customer_email],
482482
business_document={"Order": order.to_dict()}
483483
)
484-
484+
485485
if response.error:
486486
print(f"Failed to send email for order {order.id}: {response.error.message}")
487487
else:
@@ -505,7 +505,7 @@ def send_order_confirmation(order):
505505

506506
# Create client and send
507507
client = create_client(destination_name="ARIBA_OUTPUT_SERVICE")
508-
508+
509509
response = client.send_email(
510510
notification_template_key="ORDER_CONFIRMATION",
511511
to=[order.customer_email],
@@ -761,7 +761,7 @@ from sap_cloud_sdk.outputmanagement import create_client
761761

762762
def send_order_confirmation(order):
763763
client = create_client(destination_name="ARIBA_OUTPUT_SERVICE")
764-
764+
765765
response = client.send_email(
766766
notification_template_key="ORDER_CONFIRMATION",
767767
to=[order.customer_email],
@@ -794,7 +794,7 @@ from sap_cloud_sdk.outputmanagement import create_client
794794

795795
def send_invoice_with_pdf(invoice, pdf_dms_url):
796796
client = create_client(destination_name="ARIBA_OUTPUT_SERVICE")
797-
797+
798798
response = client.send_email(
799799
notification_template_key="INVOICE_WITH_PDF",
800800
to=[invoice.customer_email],
@@ -821,7 +821,7 @@ from sap_cloud_sdk.outputmanagement import create_client
821821

822822
def send_bulk_notification(recipients, notification_data):
823823
client = create_client(destination_name="ARIBA_OUTPUT_SERVICE")
824-
824+
825825
response = client.send_email(
826826
notification_template_key="BULK_NOTIFICATION",
827827
to=recipients,
@@ -894,16 +894,16 @@ from sap_cloud_sdk.outputmanagement import (
894894

895895
try:
896896
client = create_client(destination_name="ARIBA_OUTPUT_SERVICE")
897-
897+
898898
response = client.send_email(
899899
notification_template_key="NOTIFICATION",
900900
to=["user@example.com"],
901901
business_document={"Document": {"id": "123"}}
902902
)
903-
903+
904904
if response.error:
905905
print(f"Error: {response.error.message}")
906-
906+
907907
except ValidationException as e:
908908
print(f"Validation error: {e.message}")
909909
except AuthenticationException as e:
@@ -955,5 +955,5 @@ For issues or questions:
955955

956956
---
957957

958-
**Version:** 3.0.0
959-
**Last Updated:** 2026-06-23
958+
**Version:** 3.0.0
959+
**Last Updated:** 2026-06-23

tests/outputmanagement/unit/conftest.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@pytest.fixture
1010
def sample_email_config():
1111
"""Provide a sample email configuration for testing."""
12-
from sap_cloud_sdk.outputmanagement.models import EmailConfiguration
12+
from sap_cloud_sdk.outputmanagement import EmailConfiguration
1313

1414
return EmailConfiguration(
1515
emailNotificationTemplateKey="TEST_TEMPLATE",
@@ -21,7 +21,7 @@ def sample_email_config():
2121
@pytest.fixture
2222
def sample_attachment():
2323
"""Provide a sample attachment for testing."""
24-
from sap_cloud_sdk.outputmanagement.models import AttachmentConfig, FormConfiguration
24+
from sap_cloud_sdk.outputmanagement import AttachmentConfig, FormConfiguration
2525

2626
form_config = FormConfiguration(form_id="test-form")
2727
return AttachmentConfig(formConfiguration=form_config)
@@ -30,15 +30,15 @@ def sample_attachment():
3030
@pytest.fixture
3131
def sample_output_response():
3232
"""Provide a sample output response for testing."""
33-
from sap_cloud_sdk.outputmanagement.models import OutputResponse
33+
from sap_cloud_sdk.outputmanagement import OutputResponse
3434

3535
return OutputResponse(outputRequestId="test-req-123")
3636

3737

3838
@pytest.fixture
3939
def sample_pre_generated_attachment():
4040
"""Provide a sample pre-generated attachment for testing."""
41-
from sap_cloud_sdk.outputmanagement.models import PreGeneratedAttachment
41+
from sap_cloud_sdk.outputmanagement import PreGeneratedAttachment
4242

4343
return PreGeneratedAttachment(
4444
url="https://dms.example.com/attachments/test-file.pdf",
@@ -49,9 +49,7 @@ def sample_pre_generated_attachment():
4949
@pytest.fixture
5050
def sample_destination_config():
5151
"""Provide a sample destination configuration for testing."""
52-
from sap_cloud_sdk.outputmanagement.config.destination_credential_config import (
53-
DestinationCredentialConfig,
54-
)
52+
from sap_cloud_sdk.outputmanagement import DestinationCredentialConfig
5553

5654
return DestinationCredentialConfig(
5755
destination_name="test-output-management"

tests/outputmanagement/unit/test_basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_constants_import(self):
3333
"""Test that constants can be imported."""
3434
from sap_cloud_sdk.outputmanagement import FileFormat, Channel
3535
from sap_cloud_sdk.outputmanagement.constants import Constants
36-
36+
3737
assert Constants.API_OUTPUT_CONTROL is not None
3838
assert FileFormat.PDF is not None
3939
assert Channel.INTERNAL_EMAIL is not None
@@ -88,4 +88,4 @@ def test_config_import(self):
8888
def test_utils_import(self):
8989
"""Test that utils can be imported."""
9090
from sap_cloud_sdk.outputmanagement.utils import RequestValidator
91-
assert RequestValidator is not None
91+
assert RequestValidator is not None

tests/outputmanagement/unit/test_comprehensive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,4 +323,4 @@ def test_email_with_dms_attachments_scenario(self):
323323
assert email.attachment is not None
324324
assert email.attachment.pre_generated_attachments is not None
325325
assert len(email.attachment.pre_generated_attachments) == 3
326-
assert all(att.source == "DMS" for att in email.attachment.pre_generated_attachments)
326+
assert all(att.source == "DMS" for att in email.attachment.pre_generated_attachments)

tests/outputmanagement/unit/test_email_client_mcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,4 +384,4 @@ async def test_send_email_with_mcp_no_optional_params(self, output_management_cl
384384
assert "cc" not in email_config or email_config.get("cc") is None
385385

386386
# Attachment should not be present when not provided
387-
assert "attachment" not in email_config or email_config.get("attachment") is None
387+
assert "attachment" not in email_config or email_config.get("attachment") is None

tests/outputmanagement/unit/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,4 @@ def test_output_response_lifecycle(self):
203203
assert error.output_request_id is None
204204
assert error.error is not None
205205
assert error.error.message == "Failed to generate output"
206-
assert error.error.code == "ERR_001"
206+
assert error.error.code == "ERR_001"

tests/outputmanagement/unit/test_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,4 @@ def test_pre_generated_attachment_equality(self):
260260
)
261261

262262
assert att1 == att2
263-
assert att1 != att3
263+
assert att1 != att3

0 commit comments

Comments
 (0)