Beispiel #1
0
def test_validate_pathloss(output_hdul, request):
    # want to run this pytest?
    # output_hdul[2] = pathloss_completion_tests, pathloss_reffile_tests, pathloss_validation_tests
    run_pytests = output_hdul[3][2]
    if not run_pytests:
        msg = "Skipping validation pytest: option to run Pytest is set to False in PTT_config.cfg file.\n"
        print(msg)
        logging.info(msg)
        pytest.skip(msg)
    else:
        msg = "\n * Running validation pytest...\n"
        print(msg)
        logging.info(msg)
        assert request.getfixturevalue(
            "validate_pathloss"
        ), "Output value from pathloss is greater than threshold."
Beispiel #2
0
def install_hooks(request):
    urllibver = request.getfixturevalue('urllibver')

    if urllibver == 'urllib2':
        if six.PY3:
            yield None
            return
        module = urllib2
    else:
        module = urllib.request

    old_opener = module._opener
    old_callee_headers = CONFIG.callee_name_headers
    old_endpoint_headers = CONFIG.callee_endpoint_headers

    urllib2_hooks.install_patches.__original_func()
    CONFIG.callee_name_headers = ['Remote-Loc']
    CONFIG.callee_endpoint_headers = ['Remote-Op']

    yield module

    module.install_opener(old_opener)
    CONFIG.callee_name_headers = old_callee_headers
    CONFIG.callee_endpoint_headers = old_endpoint_headers
Beispiel #3
0
def file_server(request):
    if request.param == "ipv4":
        return request.getfixturevalue("file_server4")
    else:
        return request.getfixturevalue("file_server6")
Beispiel #4
0
def db_uri(request):
    if request.param == 'mongodb':
        return request.getfixturevalue('mongodb_uri')
    return 'sqlite:pmxbot.sqlite'