Skip to content

Commit

Permalink
Test for trace_id on query
Browse files Browse the repository at this point in the history
PYTHON-302
  • Loading branch information
aholmberg committed May 12, 2015
1 parent 58536f5 commit bc3ea9b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/integration/standard/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ def test_trace_prints_okay(self):

cluster.shutdown()

def test_trace_id_to_query(self):
cluster = Cluster(protocol_version=PROTOCOL_VERSION)
session = cluster.connect()

query = "SELECT * FROM system.local"
statement = SimpleStatement(query)
self.assertIsNone(statement.trace_id)
future = session.execute_async(statement, trace=True)

# query should have trace_id, even before trace is obtained
future.result()
self.assertIsNotNone(statement.trace_id)

cluster.shutdown()

def test_trace_ignores_row_factory(self):
cluster = Cluster(protocol_version=PROTOCOL_VERSION)
session = cluster.connect()
Expand Down

0 comments on commit bc3ea9b

Please sign in to comment.