File tree Expand file tree Collapse file tree
tests/core/unit/auditlog_ng/unit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,5 +95,14 @@ indent-style = "space"
9595skip-magic-trailing-comma = false
9696line-ending = " auto"
9797
98+ [tool .ty ]
99+
98100[tool .ty .environment ]
99101python-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+ ]
Original file line number Diff line number Diff line change 11"""Tests for AuditClient."""
2+ from __future__ import annotations
23
34import json
5+ from typing import TypedDict
6+ from unittest .mock import MagicMock , Mock , patch
7+
48import pytest
5- from unittest .mock import patch , MagicMock , Mock
69
710from sap_cloud_sdk .core .auditlog_ng .client import AuditClient
811from sap_cloud_sdk .core .auditlog_ng .config import AuditLogNGConfig , SCHEMA_URL
912from 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
You can’t perform that action at this time.
0 commit comments