Skip to content

Commit 49a27a3

Browse files
Abel Milashclaude
andcommitted
Add export tests for package-level __all__ symbols
Add test_package_exports.py: 3 tests verifying every symbol in __all__ is importable from PowerPlatform.Dataverse.{core,models,operations}. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 01562a2 commit 49a27a3

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

tests/unit/test_package_exports.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT license.
3+
4+
"""Tests that every symbol in __all__ is importable from each package namespace."""
5+
6+
import unittest
7+
8+
9+
class TestCoreExports(unittest.TestCase):
10+
"""Every name in PowerPlatform.Dataverse.core.__all__ must be importable."""
11+
12+
def test_all_symbols_importable(self):
13+
import PowerPlatform.Dataverse.core as m
14+
15+
for name in m.__all__:
16+
self.assertTrue(hasattr(m, name), f"{name!r} is in __all__ but missing from PowerPlatform.Dataverse.core")
17+
18+
19+
class TestModelsExports(unittest.TestCase):
20+
"""Every name in PowerPlatform.Dataverse.models.__all__ must be importable."""
21+
22+
def test_all_symbols_importable(self):
23+
import PowerPlatform.Dataverse.models as m
24+
25+
for name in m.__all__:
26+
self.assertTrue(hasattr(m, name), f"{name!r} is in __all__ but missing from PowerPlatform.Dataverse.models")
27+
28+
29+
class TestOperationsExports(unittest.TestCase):
30+
"""Every name in PowerPlatform.Dataverse.operations.__all__ must be importable."""
31+
32+
def test_all_symbols_importable(self):
33+
import PowerPlatform.Dataverse.operations as m
34+
35+
for name in m.__all__:
36+
self.assertTrue(
37+
hasattr(m, name), f"{name!r} is in __all__ but missing from PowerPlatform.Dataverse.operations"
38+
)
39+
40+
41+
if __name__ == "__main__":
42+
unittest.main()

0 commit comments

Comments
 (0)