mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #24313 from nicholascapo/fix-22991-npm.installed-test-true
Fix #22991 Correctly set result when test=True
This commit is contained in:
commit
ae681a4db1
2 changed files with 3 additions and 1 deletions
|
@ -169,6 +169,7 @@ def installed(name,
|
|||
if pkgs_satisfied:
|
||||
comment_msg.append('Package(s) {0!r} satisfied by {1}'
|
||||
.format(', '.join(pkg_list), ', '.join(pkgs_satisfied)))
|
||||
ret['result'] = True
|
||||
|
||||
ret['comment'] = '. '.join(comment_msg)
|
||||
return ret
|
||||
|
|
|
@ -27,6 +27,7 @@ npm.__opts__ = {}
|
|||
|
||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
||||
class NpmTestCase(TestCase):
|
||||
|
||||
'''
|
||||
Test cases for salt.states.npm
|
||||
'''
|
||||
|
@ -56,7 +57,7 @@ class NpmTestCase(TestCase):
|
|||
with patch.dict(npm.__opts__, {'test': True}):
|
||||
comt = ("Package(s) 'coffee-script' "
|
||||
"satisfied by coffee-script@1.2")
|
||||
ret.update({'comment': comt, 'result': None})
|
||||
ret.update({'comment': comt, 'result': True})
|
||||
self.assertDictEqual(npm.installed(name), ret)
|
||||
|
||||
with patch.dict(npm.__opts__, {'test': False}):
|
||||
|
|
Loading…
Add table
Reference in a new issue