From 50f9f1217878fa330f885a5f6620d0d50a07cf27 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Fri, 18 Aug 2023 20:47:54 +0200 Subject: [PATCH] Fix test issues Signed-off-by: Cristian Le --- fmf/base.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fmf/base.py b/fmf/base.py index fc369150..3460745b 100644 --- a/fmf/base.py +++ b/fmf/base.py @@ -338,8 +338,7 @@ def update(self, data: Optional[TreeData]) -> None: # Handle fmf directives first try: directives = data.pop("/") - assert isinstance(directives, dict) - self._process_directives(directives) + self._process_directives(directives) # type: ignore except KeyError: pass @@ -497,8 +496,11 @@ def child(self, name: str, data: Optional[TreeDataPath], # Save source file if source is not None: self.children[name].sources.append(source) - assert isinstance(data, dict) - self.children[name]._raw_data = copy.deepcopy(data) + if data is None: + self.children[name]._raw_data = {} + else: + assert isinstance(data, dict) + self.children[name]._raw_data = copy.deepcopy(data) def grow(self, path: str) -> None: """ @@ -692,7 +694,7 @@ def node(reference: TreeData) -> Tree: if 'url' in reference: tree = utils.fetch_tree( str(reference.get('url')), - str(reference.get('ref')), + reference.get('ref'), # type: ignore str(reference.get('path', '.')).lstrip('/')) # Use local files else: