diff options
author | Linda Wang <wangwulin@huawei.com> | 2017-08-02 02:41:15 +0000 |
---|---|---|
committer | Linda Wang <wangwulin@huawei.com> | 2017-08-03 02:20:50 +0000 |
commit | a4f8adbb935737122b4800efbb19b9d9b75c7e01 (patch) | |
tree | 3531fe4394cfdb0821dae356e06b22a007b299ab /snaps/domain/test/project_tests.py | |
parent | 13e17646bccbcafbac13b144e24eee14125d33e3 (diff) |
Add domain name when creating projects and users
(spisarski)
Also clarified the difference between domain ID and name
Added helper methods and domain object for Domains
JIRA: FUNCTEST-858
Change-Id: Iccd7eef56713a4ad0c23232073f52bc71168bf5c
Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'snaps/domain/test/project_tests.py')
-rw-r--r-- | snaps/domain/test/project_tests.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/snaps/domain/test/project_tests.py b/snaps/domain/test/project_tests.py index 73939f0..3f4fca6 100644 --- a/snaps/domain/test/project_tests.py +++ b/snaps/domain/test/project_tests.py @@ -14,12 +14,12 @@ # limitations under the License. import unittest -from snaps.domain.project import Project +from snaps.domain.project import Project, Domain class ProjectDomainObjectTests(unittest.TestCase): """ - Tests the construction of the snaps.domain.test.Project class + Tests the construction of the snaps.domain.project.Project class """ def test_construction_positional_minimal(self): @@ -45,3 +45,19 @@ class ProjectDomainObjectTests(unittest.TestCase): self.assertEqual('foo', project.name) self.assertEqual('123-456', project.id) self.assertEqual('hello', project.domain_id) + + +class DomainDomainObjectTests(unittest.TestCase): + """ + Tests the construction of the snaps.domain.project.Domain class + """ + + def test_construction_positional(self): + domain = Domain('foo', '123-456') + self.assertEqual('foo', domain.name) + self.assertEqual('123-456', domain.id) + + def test_construction_named_minimal(self): + domain = Domain(domain_id='123-456', name='foo') + self.assertEqual('foo', domain.name) + self.assertEqual('123-456', domain.id) |