Skip to content

Commit

Permalink
Add test cases for empty query
Browse files Browse the repository at this point in the history
  • Loading branch information
Holi0317 committed Jun 30, 2024
1 parent 85b5014 commit ec7cff1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,18 @@ def test_span_name(self):
cursor.execute("/* leading comment */ query")
cursor.execute("/* leading comment */ query /* trailing comment */")
cursor.execute("query /* trailing comment */")
cursor.execute("")
cursor.execute("--")
spans_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(spans_list), 6)
self.assertEqual(len(spans_list), 8)
self.assertEqual(spans_list[0].name, "Test")
self.assertEqual(spans_list[1].name, "multi")
self.assertEqual(spans_list[2].name, "tab")
self.assertEqual(spans_list[3].name, "query")
self.assertEqual(spans_list[4].name, "query")
self.assertEqual(spans_list[5].name, "query")
self.assertEqual(spans_list[6].name, "postgresql")
self.assertEqual(spans_list[7].name, "--")

# pylint: disable=unused-argument
def test_not_recording(self):
Expand Down

0 comments on commit ec7cff1

Please sign in to comment.