From da29301f6b8d90fda8327ba31e7ec5d405a80196 Mon Sep 17 00:00:00 2001 From: TheBurchLog <5104941+TheBurchLog@users.noreply.github.com> Date: Tue, 12 Mar 2024 06:35:34 -0400 Subject: [PATCH] fixed testing --- brewtils/models.py | 3 ++- brewtils/schemas.py | 4 ++-- brewtils/test/comparable.py | 1 + test/models_test.py | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/brewtils/models.py b/brewtils/models.py index 8e85d440..3bf80e9c 100644 --- a/brewtils/models.py +++ b/brewtils/models.py @@ -1676,12 +1676,13 @@ def __str__(self): def __repr__(self): return ( - "" ) % ( self.id, self.name, + self.description, self.permission, self.scope_gardens, self.scope_namespaces, diff --git a/brewtils/schemas.py b/brewtils/schemas.py index b43a1e2a..991f7391 100644 --- a/brewtils/schemas.py +++ b/brewtils/schemas.py @@ -558,10 +558,10 @@ class ResolvableSchema(BaseSchema): class RoleSchema(BaseSchema): + permission = fields.Str() + description = fields.Str(allow_none=True) id = fields.Str(allow_none=True) name = fields.Str() - description = fields.Str(allow_none=True) - permission = fields.Str() scope_gardens = fields.List(fields.Str(), allow_none=True) scope_namespaces = fields.List(fields.Str(), allow_none=True) scope_systems = fields.List(fields.Str(), allow_none=True) diff --git a/brewtils/test/comparable.py b/brewtils/test/comparable.py index f1197ed6..377720ec 100644 --- a/brewtils/test/comparable.py +++ b/brewtils/test/comparable.py @@ -245,6 +245,7 @@ def assert_user_equal(obj1, obj2, do_raise=False): obj2, expected_type=User, deep_fields={ + "local_roles": partial(assert_role_equal, do_raise=True), "remote_roles": partial(assert_role_equal, do_raise=True), "remote_user_mapping": partial(assert_remote_user_map_equal, do_raise=True), }, diff --git a/test/models_test.py b/test/models_test.py index 6b136600..76744edf 100644 --- a/test/models_test.py +++ b/test/models_test.py @@ -548,14 +548,14 @@ def test_repr(self, user): class TestRole(object): @pytest.fixture def role(self): - return Role(name="bg-admin", permission="ADMIN") + return Role(name="bg-admin", permission="PLUGIN_ADMIN") def test_str(self, role): assert str(role) == "bg-admin" def test_repr(self, role): assert repr(role) == ( - "" )