mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Fix unit test relative imports, and permissions for included collection requirements (#29)
* Fix Hetzner firewall unit test imports.
* Make sure tests can actually access collections.
* Fix more relative imports.
* Fix more relative imports.
* Fix more includes.
* Fix more tests.
* One more.
* Fix syntax error in sanity import tests (invalid escape sequence "\$" caused by non-raw docs block)
* Fix permissions of ansible-test parts for sanity tests.
* Revert "Fix permissions of ansible-test parts for sanity tests."
This reverts commit c2713f0a12.
This commit is contained in:
@@ -39,8 +39,8 @@ class OneViewBaseTest(object):
|
||||
resource_module_path_name = re.findall('[A-Z][^A-Z]*', resource_module_path_name)
|
||||
resource_module_path_name = 'oneview_' + str.join('_', resource_module_path_name).lower()
|
||||
|
||||
ansible = __import__('ansible')
|
||||
oneview_module = ansible.modules.remote_management.oneview
|
||||
ansible_collections = __import__('ansible_collections')
|
||||
oneview_module = ansible_collections.community.general.plugins.modules.remote_management.oneview
|
||||
resource_module = getattr(oneview_module, resource_module_path_name)
|
||||
self.testing_class = getattr(resource_module, resource_name)
|
||||
testing_module = self.testing_class.__module__.split('.')[-1]
|
||||
@@ -143,9 +143,9 @@ class OneViewBaseTestCase(object):
|
||||
|
||||
def __set_module_examples(self):
|
||||
# Load scenarios from module examples (Also checks if it is a valid yaml)
|
||||
ansible = __import__('ansible')
|
||||
ansible_collections = __import__('ansible_collections')
|
||||
testing_module = self.testing_class.__module__.split('.')[-1]
|
||||
self.testing_module = getattr(ansible.modules.remote_management.oneview, testing_module)
|
||||
self.testing_module = getattr(ansible_collections.community.general.plugins.modules.remote_management.oneview, testing_module)
|
||||
|
||||
try:
|
||||
# Load scenarios from module examples (Also checks if it is a valid yaml)
|
||||
|
||||
Reference in New Issue
Block a user