summaryrefslogtreecommitdiffstats
path: root/snaps/domain/test
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-07-13 08:15:40 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-07-13 08:15:40 -0600
commit317a6f8c44efbefaeb800edafcc6fb4cb88bedea (patch)
treefa0842f287b8e8e2940347ed4c70d07fddb1d365 /snaps/domain/test
parente6326cd5e826d19e4dd2b096c17aff35da1757b3 (diff)
Created domain class for roles.
Create Role domain class so keystone_utils.py functions returning role objects will not be leaking out implementation details as each API version can change these data structures and this should all be handled by the SNAPS neutron utility. JIRA: SNAPS-119 Change-Id: I6918a45c1c414ee6b104ec36e63c540d6f656e30 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/domain/test')
-rw-r--r--snaps/domain/test/role_tests.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/snaps/domain/test/role_tests.py b/snaps/domain/test/role_tests.py
new file mode 100644
index 0000000..541b22d
--- /dev/null
+++ b/snaps/domain/test/role_tests.py
@@ -0,0 +1,33 @@
+# Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs")
+# and others. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import unittest
+from snaps.domain.role import Role
+
+
+class RoleDomainObjectTests(unittest.TestCase):
+ """
+ Tests the construction of the snaps.domain.test.Role class
+ """
+
+ def test_construction_positional(self):
+ role = Role('foo', '123-456')
+ self.assertEqual('foo', role.name)
+ self.assertEqual('123-456', role.id)
+
+ def test_construction_named(self):
+ role = Role(role_id='123-456', name='foo')
+ self.assertEqual('foo', role.name)
+ self.assertEqual('123-456', role.id)