def test_set_kmp_vars_config_json_exists(mock_json):
    """Test config.json when exists"""
    # Setup base model init with test settings
    platform_util = MagicMock()
    args = MagicMock(verbose=True, model_name=test_model_name)
    os.environ["PYTHON_EXE"] = "python"
    base_model_init = BaseModelInitializer(args, [], platform_util)

    file_descriptor, config_file_path = tempfile.mkstemp(suffix=".json")

    base_model_init.set_kmp_vars(config_file_path)
def test_set_kmp_vars_config_json_does_not_exists():
    """Test config.json does not exist"""
    # Setup base model init with test settings
    platform_util = MagicMock()
    args = MagicMock(verbose=True, model_name=test_model_name)
    os.environ["PYTHON_EXE"] = "python"
    base_model_init = BaseModelInitializer(args, [], platform_util)

    config_file_path = '/test/foo/config.json'

    with catch_stdout() as caught_output:
        base_model_init.set_kmp_vars(config_file_path)
        output = caught_output.getvalue()

    assert "Warning: File {} does not exist and \
            cannot be used to set KMP environment variables".format(config_file_path) == output.strip()