mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Starting to add additional unit tests for VariableManager
Required some rewiring in inventory code to make sure we're using the DataLoader class for some data file operations, which makes mocking them much easier. Also identified two corner cases not currently handled by the code, related to inventory variable sources and which one "wins". Also noticed we weren't properly merging variables from multiple group/host_var file locations (inventory directory vs. playbook directory locations) so fixed as well.
This commit is contained in:
parent
87f75a50ad
commit
ff9f5d7dc8
13 changed files with 233 additions and 54 deletions
|
@ -57,6 +57,10 @@ class DictDataLoader(DataLoader):
|
|||
def list_directory(self, path):
|
||||
return [x for x in self._known_directories]
|
||||
|
||||
def is_executable(self, path):
|
||||
# FIXME: figure out a way to make paths return true for this
|
||||
return False
|
||||
|
||||
def _add_known_directory(self, directory):
|
||||
if directory not in self._known_directories:
|
||||
self._known_directories.append(directory)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue