Skip to content

Commit

Permalink
Fixed whitespaces at mongodb_user.present test saltstack#53963
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuenor committed Jul 24, 2019
1 parent 8fa56f8 commit c3950a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/unit/states/test_mongodb_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_present_existing_user(self):
self.assertDictEqual(mongodb_user.present(name, passwd, port={}), ret)

mock_t = MagicMock(return_value=True)
mock = MagicMock(return_value=[{'user': name, 'roles':[{'db':db,'role': current_role}]}])
mock = MagicMock(return_value=[{'user': name, 'roles':[{'db':db, 'role': current_role}]}])
with patch.dict(mongodb_user.__salt__,
{
'mongodb.user_create': mock_t,
Expand All @@ -98,19 +98,19 @@ def test_present_existing_user(self):
comt = ('User {0} is already present and should be updated if neccesary.'
).format(name)
ret.update({'comment': comt, 'result': None})
self.assertDictEqual(mongodb_user.present(name, passwd, database=db,roles=new_role), ret)
self.assertDictEqual(mongodb_user.present(name, passwd, database=db, roles=new_role), ret)

with patch.dict(mongodb_user.__opts__, {'test': True}):
comt = ('User {0} is already present and should be updated if neccesary.'
.format(name))
ret.update({'comment': comt, 'result': None})
self.assertDictEqual(mongodb_user.present(name, passwd, database=db,roles=new_role), ret)
self.assertDictEqual(mongodb_user.present(name, passwd, database=db, roles=new_role), ret)

with patch.dict(mongodb_user.__opts__, {'test': False}):
comt = ('User {0} is already present'.format(name))
ret.update({'comment': comt, 'result': True,
'changes': {name: {'database': db, 'roles': {'old': current_role_as_dict, 'new': new_role}}}})
self.assertDictEqual(mongodb_user.present(name, passwd, database=db,roles=new_role), ret)
self.assertDictEqual(mongodb_user.present(name, passwd, database=db, roles=new_role), ret)

# 'absent' function tests: 1

Expand Down

0 comments on commit c3950a2

Please sign in to comment.