Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tests
  • Loading branch information
lzchen committed Feb 23, 2024
commit 356351ba2553bf0bb58813def69cbc034d0899a1
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def test_ping_exception(self):
self.assertIsNone(response)


@mock.patch("azure.monitor.opentelemetry.exporter._utils.PeriodicTask.__new__")
@mock.patch("azure.monitor.opentelemetry.exporter._quickpulse._exporter.PeriodicTask.__new__")
def test_quickpulsereader_init(self, task_mock):
task_inst_mock = mock.Mock()
task_mock.return_value = task_inst_mock
Expand All @@ -231,7 +231,7 @@ def test_quickpulsereader_init(self, task_mock):
task_inst_mock.start.assert_called_once()

@mock.patch("azure.monitor.opentelemetry.exporter._quickpulse._exporter._QuickpulseExporter._ping")
@mock.patch("azure.monitor.opentelemetry.exporter._utils.PeriodicTask.__new__")
@mock.patch("azure.monitor.opentelemetry.exporter._quickpulse._exporter.PeriodicTask.__new__")
def test_quickpulsereader_ticker_ping_true(self, task_mock, ping_mock):
task_inst_mock = mock.Mock()
task_mock.return_value = task_inst_mock
Expand All @@ -258,7 +258,7 @@ def test_quickpulsereader_ticker_ping_true(self, task_mock, ping_mock):
# TODO: Other ticker cases

@mock.patch("azure.monitor.opentelemetry.exporter._quickpulse._exporter._QuickpulseExporter.export")
@mock.patch("azure.monitor.opentelemetry.exporter._utils.PeriodicTask.__new__")
@mock.patch("azure.monitor.opentelemetry.exporter._quickpulse._exporter.PeriodicTask.__new__")
def test_quickpulsereader_receive_metrics(self, task_mock, export_mock):
task_inst_mock = mock.Mock()
task_mock.return_value = task_inst_mock
Expand All @@ -279,7 +279,7 @@ def test_quickpulsereader_receive_metrics(self, task_mock, export_mock):
)

@mock.patch("azure.monitor.opentelemetry.exporter._quickpulse._exporter._QuickpulseExporter.export")
@mock.patch("azure.monitor.opentelemetry.exporter._utils.PeriodicTask.__new__")
@mock.patch("azure.monitor.opentelemetry.exporter._quickpulse._exporter.PeriodicTask.__new__")
def test_quickpulsereader_receive_metrics_exception(self, task_mock, export_mock):
task_inst_mock = mock.Mock()
task_mock.return_value = task_inst_mock
Expand Down