コード例 #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)