Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amitsetty committed Sep 9, 2022
1 parent 1f2a538 commit a3d4d4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def started(self, event: monitoring.CommandStartedEvent):
return
command = event.command.get(event.command_name, "")
name = event.database_name
name += "." + event.command_name
name += "." + event.command_name
statement = event.command_name
if command:
statement += " " + str(command)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def test_pymongo_instrumentor(self):
)
with patch:
PymongoInstrumentor().instrument()

self.assertTrue(mock_register.called)

def test_started(self):
Expand All @@ -59,7 +58,7 @@ def test_started(self):
# pylint: disable=protected-access
span = command_tracer._pop_span(mock_event)
self.assertIs(span.kind, trace_api.SpanKind.CLIENT)
self.assertEqual(span.name, "command_name.find")
self.assertEqual(span.name, "database_name.command_name")
self.assertEqual(span.attributes[SpanAttributes.DB_SYSTEM], "mongodb")
self.assertEqual(
span.attributes[SpanAttributes.DB_NAME], "database_name"
Expand Down Expand Up @@ -189,8 +188,7 @@ def test_int_command(self):

self.assertEqual(len(spans_list), 1)
span = spans_list[0]

self.assertEqual(span.name, "command_name.123")
self.assertEqual(span.name, "database_name.command_name")


class MockCommand:
Expand Down

0 comments on commit a3d4d4f

Please sign in to comment.