Skip to content

Commit

Permalink
fix: update remaining tests to expect collection name
Browse files Browse the repository at this point in the history
  • Loading branch information
keithZmudzinski committed Oct 14, 2024
1 parent ef5719b commit 2b8cdea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_execute(self):
stmt = "CREATE TABLE IF NOT EXISTS test (id INT)"
with self._tracer.start_as_current_span("rootSpan"):
self._cursor.execute(stmt)
self.validate_spans("CREATE")
self.validate_spans("CREATE test")

def test_execute_with_connection_context_manager(self):
"""Should create a child span for execute with connection context"""
Expand All @@ -93,23 +93,23 @@ def test_execute_with_connection_context_manager(self):
with self._connection as conn:
cursor = conn.cursor()
cursor.execute(stmt)
self.validate_spans("CREATE")
self.validate_spans("CREATE test")

def test_execute_with_cursor_context_manager(self):
"""Should create a child span for execute with cursor context"""
stmt = "CREATE TABLE IF NOT EXISTS test (id INT)"
with self._tracer.start_as_current_span("rootSpan"):
with self._connection.cursor() as cursor:
cursor.execute(stmt)
self.validate_spans("CREATE")
self.validate_spans("CREATE test")

def test_executemany(self):
"""Should create a child span for executemany"""
stmt = "INSERT INTO test (id) VALUES (%s)"
with self._tracer.start_as_current_span("rootSpan"):
data = (("1",), ("2",), ("3",))
self._cursor.executemany(stmt, data)
self.validate_spans("INSERT")
self.validate_spans("INSERT test")

def test_callproc(self):
"""Should create a child span for callproc"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,23 @@ def test_execute(self):
stmt = "CREATE TABLE IF NOT EXISTS test (id INT)"
with self._tracer.start_as_current_span("rootSpan"):
self._cursor.execute(stmt)
self.validate_spans("CREATE")
self.validate_spans("CREATE test")

def test_execute_with_cursor_context_manager(self):
"""Should create a child span for execute with cursor context"""
stmt = "CREATE TABLE IF NOT EXISTS test (id INT)"
with self._tracer.start_as_current_span("rootSpan"):
with self._connection.cursor() as cursor:
cursor.execute(stmt)
self.validate_spans("CREATE")
self.validate_spans("CREATE test")

def test_executemany(self):
"""Should create a child span for executemany"""
stmt = "INSERT INTO test (id) VALUES (%s)"
with self._tracer.start_as_current_span("rootSpan"):
data = (("1",), ("2",), ("3",))
self._cursor.executemany(stmt, data)
self.validate_spans("INSERT")
self.validate_spans("INSERT test")

def test_callproc(self):
"""Should create a child span for callproc"""
Expand All @@ -116,12 +116,12 @@ def test_commit(self):
data = (("4",), ("5",), ("6",))
self._cursor.executemany(stmt, data)
self._connection.commit()
self.validate_spans("INSERT")
self.validate_spans("INSERT test")

def test_rollback(self):
stmt = "INSERT INTO test (id) VALUES (%s)"
with self._tracer.start_as_current_span("rootSpan"):
data = (("7",), ("8",), ("9",))
self._cursor.executemany(stmt, data)
self._connection.rollback()
self.validate_spans("INSERT")
self.validate_spans("INSERT test")

0 comments on commit 2b8cdea

Please sign in to comment.