summaryrefslogtreecommitdiffstats
path: root/dcae-cli/dcae_cli/commands/tests
diff options
context:
space:
mode:
authorMichael Hwang <mhwang@research.att.com>2018-03-14 09:53:43 -0400
committerMichael Hwang <mhwang@research.att.com>2018-03-14 09:54:09 -0400
commit4cc7a3e4e33d607f344ac413a2cc9f763e8cf4bd (patch)
tree15ce705ba3ea275f2a43736f3e58c498ed831a06 /dcae-cli/dcae_cli/commands/tests
parentf9242fb6fd592a14b09761dfb58fb7f7e7c56607 (diff)
Use tmpdir when using mock catalog of tests
Change-Id: I8ef3e3d79729b8aff899f6cda58d75245b3ad3e4 Issue-ID: DCAEGEN2-372 Signed-off-by: Michael Hwang <mhwang@research.att.com>
Diffstat (limited to 'dcae-cli/dcae_cli/commands/tests')
-rw-r--r--dcae-cli/dcae_cli/commands/tests/test_component_cmd.py5
-rw-r--r--dcae-cli/dcae_cli/commands/tests/test_data_format_cmd.py6
-rw-r--r--dcae-cli/dcae_cli/commands/tests/test_profiles_cmd.py4
3 files changed, 8 insertions, 7 deletions
diff --git a/dcae-cli/dcae_cli/commands/tests/test_component_cmd.py b/dcae-cli/dcae_cli/commands/tests/test_component_cmd.py
index 96f99de..67769eb 100644
--- a/dcae-cli/dcae_cli/commands/tests/test_component_cmd.py
+++ b/dcae-cli/dcae_cli/commands/tests/test_component_cmd.py
@@ -39,9 +39,10 @@ def _get_spec(path):
return json.load(file)
-def test_comp_docker(mock_cli_config, obj=None):
+def test_comp_docker(mock_cli_config, mock_db_url, obj=None):
- obj = {'catalog': MockCatalog(purge_existing=True, db_name='dcae_cli.test.db', enforce_image=False),
+ obj = {'catalog': MockCatalog(purge_existing=True, db_name='dcae_cli.test.db',
+ enforce_image=False, db_url=mock_db_url),
'config': {'user': 'test-user'}}
df_kpi = os.path.join(TEST_DIR, 'mocked_components', 'collector', 'vnf-kpi.format.json')
diff --git a/dcae-cli/dcae_cli/commands/tests/test_data_format_cmd.py b/dcae-cli/dcae_cli/commands/tests/test_data_format_cmd.py
index 9a71e41..a291a74 100644
--- a/dcae-cli/dcae_cli/commands/tests/test_data_format_cmd.py
+++ b/dcae-cli/dcae_cli/commands/tests/test_data_format_cmd.py
@@ -40,9 +40,9 @@ def _get_spec(path):
return json.load(file)
-def test_basic(mock_cli_config):
-
- obj = {'catalog': MockCatalog(purge_existing=True, db_name='dcae_cli.test.db', enforce_image=False),
+def test_basic(mock_cli_config, mock_db_url, tmpdir):
+ obj = {'catalog': MockCatalog(purge_existing=True, db_name='dcae_cli.test.db',
+ enforce_image=False, db_url=mock_db_url),
'config': {'user': 'test-user'}}
runner = CliRunner()
diff --git a/dcae-cli/dcae_cli/commands/tests/test_profiles_cmd.py b/dcae-cli/dcae_cli/commands/tests/test_profiles_cmd.py
index 4380b13..be89722 100644
--- a/dcae-cli/dcae_cli/commands/tests/test_profiles_cmd.py
+++ b/dcae-cli/dcae_cli/commands/tests/test_profiles_cmd.py
@@ -34,12 +34,12 @@ from dcae_cli.util import profiles
from dcae_cli.util import config
-def test_basic(monkeypatch, tmpdir):
+def test_basic(monkeypatch, tmpdir, mock_db_url):
runner = CliRunner()
# Setup config
- test_db_url = "sqlite:///{0}/dcae_cli.db".format(util.get_app_dir())
+ test_db_url = mock_db_url
config_dict = { "user": "ninny", "active_profile": "fake-solutioning",
"db_url": test_db_url, "cli_version": "2.0.0" }
config_file = tmpdir.join("config.json")