Beispiel #1
0
def test_get_version_info_no_module():
    '''
    insights_client constants cannot be imported,
    constants object is None. Return None version.
    '''
    version_info = util.get_version_info()
    assert version_info == {'core_version': '1-1', 'client_version': None}
Beispiel #2
0
def test_get_version_info_OK(wrapper_constants):
    '''
    insights_client constants are imported OK and version
    is reported. Return version as defined
    '''
    wrapper_constants.version = 1
    version_info = util.get_version_info()
    assert version_info == {'core_version': '1-1', 'client_version': 1}
Beispiel #3
0
def test_get_version_info_no_version(wrapper_constants):
    '''
    insights_client constants are imported OK but
    constants object has no attribute "version."
    Return None version
    '''
    del wrapper_constants.version
    version_info = util.get_version_info()
    assert version_info == {'core_version': '1-1', 'client_version': None}
Beispiel #4
0
def eggVersioningCheck(checkVersion):
    currentVersion = requests.get(VERSIONING_URL)
    currentVersion = currentVersion.text
    runningVersion = get_version_info()['core_version']

    if checkVersion:
        if LooseVersion(currentVersion.strip()) < LooseVersion(runningVersion):
            raise PlaybookVerificationError(message="EGG VERSION ERROR: Current running egg is not the most recent version")

    return currentVersion
Beispiel #5
0
def test_get_version_info(run_command_get_output):
    # package_info['VERSION'] = '1'
    # package_info['RELEASE'] = '1'
    run_command_get_output.return_value = {'output': 1, 'status': 0}
    version_info = util.get_version_info()
    assert version_info == {'core_version': '1-1', 'client_version': 1}
def test_get_version_info(insights_client, run_command_get_output):
    insights_client.return_value.version.return_value = 1
    run_command_get_output.return_value = {'output': 1}
    version_info = util.get_version_info()
    assert version_info == {'core_version': 1, 'client_version': 1}