Exemplo n.º 1
0
def test_HTL_doc_examples():
    settings = satellite_postgresql_query.SatelliteAdminSettings(
        context_wrap(SATELLITE_SETTINGS_1))
    resources_table = satellite_postgresql_query.SatelliteComputeResources(
        context_wrap(SATELLITE_COMPUTE_RESOURCE_1))
    sat_sca_info = satellite_postgresql_query.SatelliteSCAStatus(
        context_wrap(SATELLITE_SCA_INFO_1))
    repositories = satellite_postgresql_query.SatelliteKatelloEmptyURLRepositories(
        context_wrap(SATELLITE_KATELLO_ROOT_REPOSITORIES))
    tasks = satellite_postgresql_query.SatelliteCoreTaskReservedResourceCount(
        context_wrap(SATELLITE_TASK_RESERVERDRESOURCE_CONTENT))
    capsules = satellite_postgresql_query.SatelliteQualifiedCapsules(
        context_wrap(SATELLITE_CAPSULES_WITH_BACKGROUND_DOWNLOADPOLICY))
    repos = satellite_postgresql_query.SatelliteQualifiedKatelloRepos(
        context_wrap(SATELLITE_REPOS_INFO))
    multi_ref_katello_repos = satellite_postgresql_query.SatelliteKatellloReposWithMultipleRef(
        context_wrap(SATELLITE_KATELLO_REPOS_WITH_MULTI_REF))
    globs = {
        'table': settings,
        'resources_table': resources_table,
        'sat_sca_info': sat_sca_info,
        'katello_root_repositories': repositories,
        'tasks': tasks,
        'capsules': capsules,
        'repos': repos,
        'multi_ref_katello_repos': multi_ref_katello_repos
    }
    failed, _ = doctest.testmod(satellite_postgresql_query, globs=globs)
    assert failed == 0
Exemplo n.º 2
0
def test_satellite_compute_resources():
    resources_table = satellite_postgresql_query.SatelliteComputeResources(
        context_wrap(SATELLITE_COMPUTE_RESOURCE_1))
    assert len(resources_table) == 2
    rows = resources_table.search(type='Foreman::Model::RHV')
    assert len(rows) == 1
    assert rows[0]['name'] == 'test_compute_resource2'
Exemplo n.º 3
0
def test_HTL_doc_examples():
    query = satellite_postgresql_query.SatellitePostgreSQLQuery(
        context_wrap(test_data_3))
    settings = satellite_postgresql_query.SatelliteAdminSettings(
        context_wrap(SATELLITE_SETTINGS_1))
    resources_table = satellite_postgresql_query.SatelliteComputeResources(
        context_wrap(SATELLITE_COMPUTE_RESOURCE_1))
    globs = {
        'query': query,
        'table': settings,
        'resources_table': resources_table,
    }
    failed, tested = doctest.testmod(satellite_postgresql_query, globs=globs)
    assert failed == 0