예제 #1
0
 def find(self,
          service_name,
          arguments=None,
          representation=None,
          **kwargs):
     representation = representation or self.representation
     args = arguments.copy() if arguments else dict()
     args.update(kwargs)
     return Cursor(self, service_name, representation, **args)
예제 #2
0
def random_cursor(mocker, random_response_dict):
    client = AppNexusClient("test", "test")
    mocker.patch.object(client, "get")
    client.get.side_effect = random_response_dict
    return Cursor(client, "campaign", representations.raw)
예제 #3
0
def test_uncallable_representation():
    with pytest.raises(TypeError):
        Cursor("dumb", "dumb", 42)
예제 #4
0
def cursor(mocker, response_dict):
    client = AppNexusClient("test", "test")
    mocker.patch.object(client, 'get')
    client.get.return_value = response_dict
    return Cursor(client, "campaign", representations.raw)
예제 #5
0
def test_cursor_without_client():
    with pytest.raises(RuntimeError):
        Cursor(None, None, None)