Exemplo n.º 1
0
def test_request_response_can_be_used_for_tests():
    """An RequestResponseStub object's has expected properties."""
    response = RequestResponseStub(payload={
                                   'url': 'https://example.com/',
                                   'params': {'abc': 123, 'def': 456}})

    assert response.json() == {'url': 'https://example.com/',
                               'params': {'abc': 123, 'def': 456}}
Exemplo n.º 2
0
def test_request_response_has_a_payload():
    """An RequestResponseStub object's has expected properties."""
    response = RequestResponseStub(payload={'abc': 123, 'def': 456})

    assert response.payload == {'abc': 123, 'def': 456}
    assert response.json() == {'abc': 123, 'def': 456}