MCPcopy Create free account
hub / github.com/apache/impala / test_duplicate_headers

Method test_duplicate_headers

tests/hs2/test_hs2.py:1339–1355  ·  view source on GitHub ↗

Test that if duplicate X-Forwarded-For headers are sent to Impala, only the first is used

(self)

Source from the content-addressed store, hash-verified

1337 expected_status_code=TCLIService.TStatusCode.ERROR_STATUS)
1338
1339 def test_duplicate_headers(self):
1340 """Test that if duplicate X-Forwarded-For headers are sent to Impala,
1341 only the first is used"""
1342 impyla_conn = impyla.connect(host=IMPALAD_HOSTNAME, port=IMPALAD_HS2_HTTP_PORT,
1343 use_http_transport=True,
1344 http_path="cliservice",
1345 get_user_custom_headers_func=get_user_custom_headers)
1346 cursor = impyla_conn.cursor(convert_types=False)
1347 cursor.execute('select 1')
1348 rows = cursor.fetchall()
1349 assert rows == [(1,)]
1350 profile = cursor.get_profile()
1351 cursor.close()
1352 impyla_conn.close()
1353 assert profile is not None
1354 assert "Http Origin: value1" in profile
1355 assert "Http Origin: value2" not in profile
1356
1357 @needs_session()
1358 def test_get_query_id(self):

Callers

nothing calls this directly

Calls 4

closeMethod · 0.65
connectMethod · 0.45
cursorMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected