Add some security group tests for the V1_1 API
This patch adds a test for NoUniqueMatch exception to the v1_1 API Change-Id: Ic9947eaed34be100c529f021432f0c388a7c3ddb Closes-Bug: #1250501
This commit is contained in:
parent
e6a51f47c4
commit
a20284ebe8
@ -2063,3 +2063,15 @@ class GetSecgroupTest(utils.TestCase):
|
||||
novaclient.v1_1.shell._get_secgroup,
|
||||
cs,
|
||||
'abc')
|
||||
|
||||
def test_with_non_unique_name(self):
|
||||
group_one = mock.MagicMock()
|
||||
group_one.name = 'group_one'
|
||||
cs = mock.Mock(**{
|
||||
'security_groups.get.return_value': 'sec_group',
|
||||
'security_groups.list.return_value': [group_one, group_one],
|
||||
})
|
||||
self.assertRaises(exceptions.NoUniqueMatch,
|
||||
novaclient.v1_1.shell._get_secgroup,
|
||||
cs,
|
||||
'group_one')
|
||||
|
Loading…
x
Reference in New Issue
Block a user