-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathtest_init.py
More file actions
53 lines (47 loc) · 2.11 KB
/
Copy pathtest_init.py
File metadata and controls
53 lines (47 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Tencent is pleased to support the open source community by making tRPC-Agent-Python available.
#
# Copyright (C) 2026 Tencent. All rights reserved.
#
# tRPC-Agent-Python is licensed under Apache-2.0.
"""Unit tests for trpc_agent_sdk.utils.__init__ re-exports.
Covers:
- All public symbols are correctly re-exported via __all__
- Each re-exported name resolves to the correct object
"""
import trpc_agent_sdk.utils as utils_pkg
from trpc_agent_sdk.utils._context_utils import AsyncClosingContextManager as _ACM
from trpc_agent_sdk.utils._execute_cmd import CommandExecResult as _CER
from trpc_agent_sdk.utils._execute_cmd import async_execute_command as _aec
from trpc_agent_sdk.utils._hash_key import user_key as _uk
from trpc_agent_sdk.utils._json_repair import json_loads_repair as _jlr
from trpc_agent_sdk.utils._json_repair import json_repair_string as _jrs
from trpc_agent_sdk.utils._registry_factory import BaseRegistryFactory as _BRF
from trpc_agent_sdk.utils._singleton import SingletonBase as _SB
from trpc_agent_sdk.utils._singleton import SingletonMeta as _SM
from trpc_agent_sdk.utils._singleton import singleton as _sg
class TestAllExports:
def test_all_contains_expected_names(self):
expected = {
"AsyncClosingContextManager",
"CommandExecResult",
"async_execute_command",
"user_key",
"json_loads_repair",
"json_repair_string",
"BaseRegistryFactory",
"SingletonBase",
"SingletonMeta",
"singleton",
}
assert set(utils_pkg.__all__) == expected
def test_reexported_objects_match_originals(self):
assert utils_pkg.AsyncClosingContextManager is _ACM
assert utils_pkg.CommandExecResult is _CER
assert utils_pkg.async_execute_command is _aec
assert utils_pkg.user_key is _uk
assert utils_pkg.json_loads_repair is _jlr
assert utils_pkg.json_repair_string is _jrs
assert utils_pkg.BaseRegistryFactory is _BRF
assert utils_pkg.SingletonBase is _SB
assert utils_pkg.SingletonMeta is _SM
assert utils_pkg.singleton is _sg