Exemplo n.º 1
0
    def test_client_uses_query_modification(self):
        """If the Query is passed as an unexpected param it should apply"""
        client = gdata.client.GDClient()
        client.http_client = atom.mock_http_core.EchoHttpClient()
        query = gdata.client.Query(max_results=7)

        client.http_client = atom.mock_http_core.SettableHttpClient(201, "CREATED", gdata.data.GDEntry().ToString(), {})
        response = client.get("https://example.com/foo", a_random_param=query)
        self.assertEqual(client.http_client.last_request.uri.query["max-results"], "7")
  def test_client_uses_query_modification(self):
    """If the Query is passed as an unexpected param it should apply"""
    client = gdata.client.GDClient()
    client.http_client = atom.mock_http_core.EchoHttpClient()
    query = gdata.client.Query(max_results=7)

    client.http_client = atom.mock_http_core.SettableHttpClient(
        201, 'CREATED', gdata.data.GDEntry().ToString(), {})
    response = client.get('https://example.com/foo', a_random_param=query)
    self.assertEqual(
        client.http_client.last_request.uri.query['max-results'], '7')