aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/HttpRequests.py
blob: 0d1d928b5aa9973f94a67c0bd17d981bcdf03c97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import requests
from robot.api import logger

def session_without_env():
    session = requests.Session()
    session.trust_env = False
    return session

def checkStatusCode(status_code, server_name):
    if status_code != 200:
        logger.error("Response status code from " + server_name + ": " + str(status_code))
        raise (Exception(server_name + " returned status code " + status_code))