feat: add read-only inventory API
This commit is contained in:
1 parent
979885bbdd
commit
51aec1b404
7 files changed
+346
-6
No files matched your search
@@ -281,11 +281,17 @@ class InventoryRepositoryIntegrationTests(unittest.TestCase):
|
||||
|
||||
|
||||
class InventoryArchitectureTests(unittest.TestCase):
|
||||
def test_inventory_package_has_no_http_layer_or_router(self):
|
||||
import app.inventory as inventory
|
||||
|
||||
def test_inventory_domain_layers_have_no_http_dependency(self):
|
||||
inventory_path = Path(__file__).parents[1] / "app" / "inventory"
|
||||
for source_path in inventory_path.glob("*.py"):
|
||||
domain_files = (
|
||||
"dependencies.py",
|
||||
"exceptions.py",
|
||||
"models.py",
|
||||
"repository.py",
|
||||
"service.py",
|
||||
)
|
||||
for filename in domain_files:
|
||||
source_path = inventory_path / filename
|
||||
tree = ast.parse(source_path.read_text(encoding="utf-8"))
|
||||
imported_modules = []
|
||||
for node in ast.walk(tree):
|
||||
@@ -298,8 +304,6 @@ class InventoryArchitectureTests(unittest.TestCase):
|
||||
source_path,
|
||||
)
|
||||
|
||||
self.assertFalse(hasattr(inventory, "router"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user