From f55674fe29b6d9fe1e28ae9082e27ba2705c67bb Mon Sep 17 00:00:00 2001 From: micafer Date: Tue, 15 Feb 2022 16:02:37 +0100 Subject: [PATCH] Fix test --- test/unit/test_scarcli.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/unit/test_scarcli.py b/test/unit/test_scarcli.py index 7c6aaddc..310c6c8d 100644 --- a/test/unit/test_scarcli.py +++ b/test/unit/test_scarcli.py @@ -18,12 +18,15 @@ import os import tempfile import yaml +import json from mock import patch sys.path.append("..") sys.path.append(".") from scar.scarcli import main +from scar.parser.cfgfile import ConfigFileParser, _DEFAULT_CFG +from scar.utils import FileUtils class TestSCARCli(unittest.TestCase): @@ -31,6 +34,12 @@ class TestSCARCli(unittest.TestCase): def __init__(self, *args): unittest.TestCase.__init__(self, *args) + def setUp(self): + if not FileUtils.is_file(ConfigFileParser.config_file_path): + FileUtils.create_folder(ConfigFileParser.config_file_folder) + FileUtils.create_file_with_content(ConfigFileParser.config_file_path, + json.dumps(_DEFAULT_CFG, indent=2)) + @patch('scar.scarcli.AWS') @patch('scar.scarcli.OSCAR') def test_main(self, oscar, aws):