Last active
August 29, 2015 14:15
-
-
Save skamithi/68907267a14e45015daa to your computer and use it in GitHub Desktop.
ansible module argument tester
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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