From 76acbab368416df4dd8d3735c79ac654d3388888 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Mar 2026 13:44:03 +0000 Subject: [PATCH 1/2] Initial plan From 4706928afcbb109baca739c6a12152e90463e3a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Mar 2026 13:51:09 +0000 Subject: [PATCH 2/2] Fix CI failure: use reset_mock() instead of call_count = 0 in test_finders.py Co-authored-by: csett86 <1392875+csett86@users.noreply.github.com> --- tests/test_finders.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/test_finders.py b/tests/test_finders.py index 242a4a3..8c07524 100644 --- a/tests/test_finders.py +++ b/tests/test_finders.py @@ -98,67 +98,67 @@ def test_whisper_finder(self, scandir_mocked): try: store = app.config['GRAPHITE']['store'] - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.foo') self.assertEqual(len(list(nodes)), 2) self.assertEqual(scandir_mocked.call_count, 0) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.foo.bar.baz') self.assertEqual(len(list(nodes)), 1) self.assertEqual(scandir_mocked.call_count, 0) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.*.ba?.{baz,foo}') self.assertEqual(len(list(nodes)), 2) self.assertEqual(scandir_mocked.call_count, 5) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.{foo,bar}.{baz,bar}.{baz,foo}') self.assertEqual(len(list(nodes)), 2) self.assertEqual(scandir_mocked.call_count, 5) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.{foo}.bar.*') self.assertEqual(len(list(nodes)), 1) self.assertEqual(scandir_mocked.call_count, 2) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.foo.{ba{r,z},baz}.baz') self.assertEqual(len(list(nodes)), 1) self.assertEqual(scandir_mocked.call_count, 1) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.{foo,garbage}.bar.baz') self.assertEqual(len(list(nodes)), 1) self.assertEqual(scandir_mocked.call_count, 1) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.{fo{o}}.bar.baz') self.assertEqual(len(list(nodes)), 1) self.assertEqual(scandir_mocked.call_count, 1) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.foo{}.bar.baz') self.assertEqual(len(list(nodes)), 1) self.assertEqual(scandir_mocked.call_count, 1) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.{fo,ba}{o}.bar.baz') self.assertEqual(len(list(nodes)), 1) self.assertEqual(scandir_mocked.call_count, 1) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.{fo,ba}{o,o}.bar.baz') self.assertEqual(len(list(nodes)), 1) self.assertEqual(scandir_mocked.call_count, 1) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('whisper_finder.{fo,ba}{o,z}.bar.baz') self.assertEqual(len(list(nodes)), 1) self.assertEqual(scandir_mocked.call_count, 1) finally: - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() @patch('graphite_render.finders.whisper.scandir', wraps=scandir_mock) def test_gzipped_whisper_finder(self, scandir_mocked): @@ -179,18 +179,18 @@ def test_gzipped_whisper_finder(self, scandir_mocked): try: store = app.config['GRAPHITE']['store'] - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('gzwhisper_finder.foo') self.assertEqual(len(list(nodes)), 2) self.assertEqual(scandir_mocked.call_count, 0) - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() nodes = store.find('gzwhisper_finder.foo{}.bar.baz') self.assertEqual(len(list(nodes)), 1) self.assertEqual(scandir_mocked.call_count, 1) finally: - scandir_mocked.call_count = 0 + scandir_mocked.reset_mock() def test_globstar(self): store = app.config['GRAPHITE']['store']