Skip to content
Permalink
Browse files

Updated user module tests

  • Loading branch information...
Rohan-sss1 committed Jun 7, 2019
1 parent 017eb0e commit 972c06cc7ca24ecdb8897422c6632ad824c0f30f
Showing with 10 additions and 11 deletions.
  1. +10 −11 test/units/modules/network/avi/test_avi_user.py
@@ -18,7 +18,6 @@ def test_create_user(self):
"username": "username",
"password": "fakepassword",
"api_version": "18.2.5"

},
"state": "present",
"name": "testuser",
@@ -39,8 +38,8 @@ def test_create_user(self):
})

avi_user.avi_ansible_api = Mock(return_value=data['mock_create_res'])
responce = avi_user.avi_ansible_api()
assert responce['changed']
response = avi_user.main()
assert response['changed']

def test_put_on_user(self):
set_module_args({
@@ -69,10 +68,10 @@ def test_put_on_user(self):
})

avi_user.avi_ansible_api = Mock(return_value = data['mock_put_res'])
responce = avi_user.avi_ansible_api()
assert responce['changed']
assert responce['obj']
assert responce['old_obj']
response = avi_user.main()
assert response['changed']
assert response['obj']
assert response['old_obj']


def test_delete_user(self):
@@ -101,7 +100,7 @@ def test_delete_user(self):
"default_tenant_ref": "/api/tenant?name=admin"
})
avi_user.avi_ansible_api = Mock(return_value= data['mock_del_res'])
responce = avi_user.avi_ansible_api()
assert responce['changed']
assert not responce['obj']
assert responce['old_obj']
response = avi_user.main()
assert response['changed']
assert not response['obj']
assert response['old_obj']

0 comments on commit 972c06c

Please sign in to comment.
You can’t perform that action at this time.