예제 #1
0
 def test_get_url(self, _get):
     _get.return_value = 'SUCCESS'
     req = Requester('foo', 'bar')
     self.assertTrue(
         req.get_url('http://dummy',
                     params={'param': 'value'},
                     headers=None) == 'SUCCESS')
예제 #2
0
 def test_get_url_get(self, _get):
     _get.return_value = 'SUCCESS'
     req = Requester('foo', 'bar')
     response = req.get_url(
         'http://dummy',
         params={'param': 'value'},
         headers=None)
     self.assertTrue(response == 'SUCCESS')
예제 #3
0
def test_get_url_get(monkeypatch):
    def fake_get(*args, **kwargs):  # pylint: disable=unused-argument
        return 'SUCCESS'

    monkeypatch.setattr(requests, 'get', fake_get)

    req = Requester('foo', 'bar')
    response = req.get_url('http://dummy',
                           params={'param': 'value'},
                           headers=None)

    assert response == 'SUCCESS'
예제 #4
0
def test_get_url_get(monkeypatch):
    def fake_get(*args, **kwargs):  # pylint: disable=unused-argument
        return 'SUCCESS'

    monkeypatch.setattr(requests, 'get', fake_get)

    req = Requester('foo', 'bar')
    response = req.get_url(
        'http://dummy',
        params={'param': 'value'},
        headers=None)

    assert response == 'SUCCESS'