generated from coulomb/repo-seed
Start user-engine implementation scaffold
This commit is contained in:
28
tests/test_domain_models.py
Normal file
28
tests/test_domain_models.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import unittest
|
||||
|
||||
from user_engine.domain import (
|
||||
AuthorizationDecision,
|
||||
AuthorizationEffect,
|
||||
CatalogLifecycle,
|
||||
)
|
||||
from user_engine.testing.fixtures import sample_catalog
|
||||
|
||||
|
||||
class DomainModelTests(unittest.TestCase):
|
||||
def test_catalog_exposes_attribute_keys(self):
|
||||
catalog = sample_catalog()
|
||||
|
||||
self.assertEqual(catalog.lifecycle, CatalogLifecycle.ACTIVE)
|
||||
self.assertEqual(catalog.attribute_keys(), {"demo.display_density"})
|
||||
|
||||
def test_authorization_decision_allowed_property(self):
|
||||
self.assertTrue(
|
||||
AuthorizationDecision(effect=AuthorizationEffect.ALLOW).allowed
|
||||
)
|
||||
self.assertFalse(
|
||||
AuthorizationDecision(effect=AuthorizationEffect.DENY).allowed
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user