Esempio n. 1
0
def FakeRequestMR(content):
    request = FakeRequest(content=content)
    request.uri = b"/change_hook/gitlab"
    request.args = {b'codebase': [b'MyCodebase']}
    request.received_headers[_HEADER_EVENT] = b"Merge Request Hook"
    request.method = b"POST"
    return request
Esempio n. 2
0
def FakeRequestMR(content):
    request = FakeRequest(content=content)
    request.uri = b"/change_hook/gitlab"
    request.args = {b'codebase': [b'MyCodebase']}
    request.received_headers[_HEADER_EVENT] = b"Merge Request Hook"
    request.method = b"POST"
    return request
    def getRequest(self):
        req = FakeRequest()
        req.method = "GET"
        req.uri = "/projects/Example%20Project/builders/runtests/builds/39/steps/Test%20IL2Cpp%20Unit%20Tests/logs/TestReport.html?_branch="
        req.clientproto = "HTTP/1.1"
        req.args = {}
        req.prepath = ""

        return req
Esempio n. 4
0
def _prepare_request(payload, headers=None):
    if headers is None:
        headers = {
            "Content-type": "application/x-www-form-urlencoded",
            "Accept": "text/plain"}
    else:
        headers = {}

    if 'comments' not in payload:
        payload['comments'] = 'test_www_hook_base submission'  # Required field

    request = FakeRequest()

    request.uri = "/change_hook/base"
    request.method = "POST"
    request.args = payload
    request.received_headers.update(headers)

    return request
Esempio n. 5
0
def _prepare_request(payload, headers=None):
    if headers is None:
        headers = {
            b"Content-type": b"application/x-www-form-urlencoded",
            b"Accept": b"text/plain"}
    else:
        headers = {}

    if b'comments' not in payload:
        payload[b'comments'] = b'test_www_hook_base submission'  # Required field

    request = FakeRequest()

    request.uri = b"/change_hook/base"
    request.method = b"POST"
    request.args = payload
    request.received_headers.update(headers)

    return request