Skip to content

Commit 2127ac2

Browse files
Exclude code checks
1 parent 469e0f8 commit 2127ac2

2 files changed

Lines changed: 34 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,14 @@ indent-style = "space"
9595
skip-magic-trailing-comma = false
9696
line-ending = "auto"
9797

98+
[tool.ty]
99+
98100
[tool.ty.environment]
99101
python-version = "3.11"
102+
103+
[tool.ty.src]
104+
include = ["src", "tests"]
105+
exclude = [
106+
"src/sap_cloud_sdk/core/auditlog_ng/gen",
107+
"src/buf",
108+
]

tests/core/unit/auditlog_ng/unit/test_client.py

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
"""Tests for AuditClient."""
2+
from __future__ import annotations
23

34
import json
5+
from typing import TypedDict
6+
from unittest.mock import MagicMock, Mock, patch
7+
48
import pytest
5-
from unittest.mock import patch, MagicMock, Mock
69

710
from sap_cloud_sdk.core.auditlog_ng.client import AuditClient
811
from sap_cloud_sdk.core.auditlog_ng.config import AuditLogNGConfig, SCHEMA_URL
912
from sap_cloud_sdk.core.auditlog_ng.exceptions import ValidationError
1013

1114

12-
def _make_config(**overrides):
13-
defaults = dict(
14-
endpoint="localhost:4317",
15-
deployment_id="deployment-123",
16-
namespace="namespace-123",
17-
insecure=True,
18-
)
15+
class ConfigKwargs(TypedDict, total=False):
16+
endpoint: str
17+
deployment_id: str
18+
namespace: str
19+
insecure: bool
20+
service_name: str
21+
cert_file: str | None
22+
key_file: str | None
23+
ca_file: str | None
24+
batch: bool
25+
compression: bool
26+
schema_url: str
27+
28+
29+
def _make_config(**overrides: ConfigKwargs) -> AuditLogNGConfig:
30+
defaults: ConfigKwargs = {
31+
"endpoint": "localhost:4317",
32+
"deployment_id": "deployment-123",
33+
"namespace": "namespace-123",
34+
"insecure": True,
35+
}
1936
defaults.update(overrides)
2037
return AuditLogNGConfig(**defaults)
2138

0 commit comments

Comments
 (0)