dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
336 stars 163 forks source link

Where are AnsibleFailJson and AnsibleExitJson defined? Missing test dependencies? #237

Closed grantcurell closed 3 years ago

grantcurell commented 3 years ago

I'm spinning myself up on unit testing with Ansible and am struggling with the import nomenclature. I've been able to adjust a lot of it for my own environment to get it to work. However, one piece I'm missing are the following in common.py:

from ansible_collections.dellemc.openmanage.tests.unit.plugins.modules.utils import set_module_args, AnsibleFailJson, \
    AnsibleExitJson
from ansible_collections.dellemc.openmanage.tests.unit.compat.mock import MagicMock

MagicMock I can just import separately with unittest.mock import MagicMock. It looks like in other collections it is bundled, but it's missing in the dellemc collection:

Edit: I figured this out - I see in the docs you are meant to copy this.

image image

I see Ansible says it should be bundled) with Ansible itself.

I also couldn't find any reference to AnsibleFailJson or AnsibleExitJson in the entire project.

image

Reading through Ansible's guide on debugging it looks like these are custom defined exceptions that should be somewhere in the project.

I can't tell if I'm missing something, particularly since I just taught myself all this, or if those definitions are missing from the project.

jagadeeshnv commented 3 years ago

@grantcurell Please refer https://github.com/dell/dellemc-openmanage-ansible-modules/blob/collections/tests/README.md for the tests dependencies

jagadeeshnv commented 3 years ago

@grantcurell Hope this solved the issue

grantcurell commented 3 years ago

@grantcurell Hope this solved the issue

Ah sorry man. I'll just close this out - I had already seen that but I've been working other coding projects so I haven't circled back around to try it out again. I'll close this though - I don't want it cluttering your board 😂