Skip to content

Instantly share code, notes, and snippets.

@skamithi
Last active August 29, 2015 14:15
Show Gist options
  • Save skamithi/68907267a14e45015daa to your computer and use it in GitHub Desktop.
Save skamithi/68907267a14e45015daa to your computer and use it in GitHub Desktop.
ansible module argument tester
import mock
import library.prefix_check as prefix_check
from nose.tools import assert_equals
@mock.patch('library.prefix_check.check_if_route_exists')
@mock.patch('library.prefix_check.AnsibleModule')
def test_module_args(mock_module,
mock_route_check):
"""
prefix_check - test module arguments
"""
prefix_check.main()
mock_module.assert_called_with(
argument_spec={
'prefix': {'required': True, 'type': 'str'},
'timeout': {'type': 'int', 'default': 5},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment