mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Fix unit tests for PR #41509
This commit is contained in:
parent
eb7ef3c856
commit
095e5949a3
@ -791,7 +791,7 @@ def endpoint_absent(name, region=None, profile=None, interface=None, **connectio
|
|||||||
profile=profile,
|
profile=profile,
|
||||||
interface=interface,
|
interface=interface,
|
||||||
**connection_args)
|
**connection_args)
|
||||||
if not endpoint or 'Error' in endpoint:
|
if not endpoint:
|
||||||
return ret
|
return ret
|
||||||
else:
|
else:
|
||||||
if __opts__.get('test'):
|
if __opts__.get('test'):
|
||||||
|
@ -317,7 +317,7 @@ class KeystoneTestCase(TestCase):
|
|||||||
'keystone.endpoint_create': mock}):
|
'keystone.endpoint_create': mock}):
|
||||||
|
|
||||||
comt = ('Endpoint for service "{0}" already exists'.format(name))
|
comt = ('Endpoint for service "{0}" already exists'.format(name))
|
||||||
ret.update({'comment': comt, 'result': None, 'changes': {}})
|
ret.update({'comment': comt, 'result': True, 'changes': {}})
|
||||||
self.assertDictEqual(keystone.endpoint_present(name), ret)
|
self.assertDictEqual(keystone.endpoint_present(name), ret)
|
||||||
|
|
||||||
with patch.dict(keystone.__opts__, {'test': True}):
|
with patch.dict(keystone.__opts__, {'test': True}):
|
||||||
@ -326,7 +326,7 @@ class KeystoneTestCase(TestCase):
|
|||||||
self.assertDictEqual(keystone.endpoint_present(name), ret)
|
self.assertDictEqual(keystone.endpoint_present(name), ret)
|
||||||
|
|
||||||
comt = ('Endpoint for service "{0}" already exists'.format(name))
|
comt = ('Endpoint for service "{0}" already exists'.format(name))
|
||||||
ret.update({'comment': comt, 'result': None, 'changes': {}})
|
ret.update({'comment': comt, 'result': True, 'changes': {}})
|
||||||
self.assertDictEqual(keystone.endpoint_present(name), ret)
|
self.assertDictEqual(keystone.endpoint_present(name), ret)
|
||||||
|
|
||||||
with patch.dict(keystone.__opts__, {'test': False}):
|
with patch.dict(keystone.__opts__, {'test': False}):
|
||||||
|
Loading…
Reference in New Issue
Block a user