summaryrefslogtreecommitdiffstats
path: root/dcae-cli/dcae_cli/catalog/mock/tests/test_mock_catalog.py
diff options
context:
space:
mode:
authorMichael Hwang <mhwang@research.att.com>2018-03-02 20:46:21 -0500
committerMichael Hwang <mhwang@research.att.com>2018-03-09 16:25:24 -0500
commitb11dae55f54720759431107e83f1070c10aacd96 (patch)
treedda6037b9301cbd20300bd566485cf4463124f4c /dcae-cli/dcae_cli/catalog/mock/tests/test_mock_catalog.py
parent141bcd47087b39d2ac3846ace864b9d9b0706ff5 (diff)
Make tox work in a fresh scenario
Severing the unit tests from the local config dependency meant refactoring code that made pure unit testing impossible. Introduced a conftest in this commit. Change-Id: Id005b8b5b0704ccac33fa8768be1642941281f34 Issue-ID: DCAEGEN2-372 Signed-off-by: Michael Hwang <mhwang@research.att.com>
Diffstat (limited to 'dcae-cli/dcae_cli/catalog/mock/tests/test_mock_catalog.py')
-rw-r--r--dcae-cli/dcae_cli/catalog/mock/tests/test_mock_catalog.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/dcae-cli/dcae_cli/catalog/mock/tests/test_mock_catalog.py b/dcae-cli/dcae_cli/catalog/mock/tests/test_mock_catalog.py
index 0c0a4e8..75b883d 100644
--- a/dcae-cli/dcae_cli/catalog/mock/tests/test_mock_catalog.py
+++ b/dcae-cli/dcae_cli/catalog/mock/tests/test_mock_catalog.py
@@ -1,7 +1,7 @@
# ============LICENSE_START=======================================================
# org.onap.dcae
# ================================================================================
-# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -277,7 +277,7 @@ _cdap_spec={
}
-def test_component_basic(catalog=None):
+def test_component_basic(mock_cli_config, catalog=None):
'''Tests basic component usage of MockCatalog'''
if catalog is None:
mc = MockCatalog(db_name='dcae_cli.test.db', purge_existing=True, enforce_image=False)
@@ -312,7 +312,7 @@ def test_component_basic(catalog=None):
assert cver == '1.0.0'
-def test_format_basic(catalog=None):
+def test_format_basic(mock_cli_config, catalog=None):
'''Tests basic data format usage of MockCatalog'''
if catalog is None:
mc = MockCatalog(db_name='dcae_cli.test.db', purge_existing=True)
@@ -351,7 +351,7 @@ def test_format_basic(catalog=None):
assert spec['self']['description'] == new_descr
-def test_discovery(catalog=None):
+def test_discovery(mock_cli_config, catalog=None):
'''Tests creation of discovery objects'''
if catalog is None:
mc = MockCatalog(db_name='dcae_cli.test.db', purge_existing=True, enforce_image=False)
@@ -393,7 +393,7 @@ def _format_tuple_set(*dds):
return set(map(_format_tuple, dds))
-def test_comp_list(catalog=None):
+def test_comp_list(mock_cli_config, catalog=None):
'''Tests the list functionality of the catalog'''
if catalog is None:
mc = MockCatalog(db_name='dcae_cli.test.db', purge_existing=True, enforce_image=False)
@@ -479,7 +479,7 @@ def test_comp_list(catalog=None):
assert len(components) == 4
-def test_format_list(catalog=None):
+def test_format_list(mock_cli_config, catalog=None):
'''Tests the list functionality of the catalog'''
if catalog is None:
mc = MockCatalog(db_name='dcae_cli.test.db', purge_existing=True, enforce_image=False)
@@ -523,7 +523,7 @@ def test_format_list(catalog=None):
assert len(formats) == 2
-def test_component_add_cdap(catalog=None):
+def test_component_add_cdap(mock_cli_config, catalog=None):
'''Adds a mock CDAP application'''
if catalog is None:
mc = MockCatalog(db_name='dcae_cli.test.db', purge_existing=True)
@@ -548,7 +548,7 @@ def test_component_add_cdap(catalog=None):
assert _cdap_spec == spec_out
-def test_get_discovery_from_spec():
+def test_get_discovery_from_spec(mock_cli_config):
mc = MockCatalog(db_name='dcae_cli.test.db', purge_existing=True,
enforce_image=False)
@@ -635,7 +635,7 @@ def test_get_discovery_from_spec():
assert actual_dmaap_config_keys == ([], [])
-def test_get_unpublished_formats(catalog=None):
+def test_get_unpublished_formats(mock_cli_config, catalog=None):
if catalog is None:
mc = MockCatalog(db_name='dcae_cli.test.db', purge_existing=True, enforce_image=False)
else: