コード例 #1
0
def test():
    data = load_acceptance_test(__file__)

    actual = PactRequest(**data['actual'])
    expected = PactRequest(**data['expected'])

    actual.headers = [{'Content-Type': 'text/plain'}]
    expected.headers = [{'Content-Type': 'text/plain'}]

    test_result = match(actual, expected)
    assert type(test_result) is Right
コード例 #2
0
ファイル: request.py プロジェクト: Kalimaha/pact-test
def test_custom_headers():
    headers = [('Content-Type', 'text')]
    r = PactRequest(headers=headers)
    assert r.headers == headers

    headers = [('Content-Type', 'application/json')]
    r.headers = headers
    assert r.headers == headers