generated from coulomb/repo-seed
29 lines
792 B
Python
29 lines
792 B
Python
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()
|