2222class TestDiscoverSensorsMocked (unittest .TestCase ):
2323 """Tests for discover_sensors with mocked InfluxDB."""
2424
25- @patch ('slicks.discovery.InfluxDBClient3 ' )
25+ @patch ('slicks.fetcher.get_influx_client ' )
2626 @patch ('slicks.discovery.config' )
2727 def test_returns_sorted_unique_sensors (self , mock_config , mock_client_class ):
2828 """Should return sorted deduplicated sensor list."""
@@ -54,7 +54,7 @@ def test_returns_sorted_unique_sensors(self, mock_config, mock_client_class):
5454
5555 self .assertEqual (result , ["SensorA" , "SensorB" ])
5656
57- @patch ('slicks.discovery.InfluxDBClient3 ' )
57+ @patch ('slicks.fetcher.get_influx_client ' )
5858 @patch ('slicks.discovery.config' )
5959 def test_returns_empty_list_when_no_data (self , mock_config , mock_client_class ):
6060 """Should return empty list when no sensors found."""
@@ -77,7 +77,7 @@ def test_returns_empty_list_when_no_data(self, mock_config, mock_client_class):
7777
7878 self .assertEqual (result , [])
7979
80- @patch ('slicks.discovery.InfluxDBClient3 ' )
80+ @patch ('slicks.fetcher.get_influx_client ' )
8181 @patch ('slicks.discovery.config' )
8282 def test_raises_on_permanent_error (self , mock_config , mock_client_class ):
8383 """Should raise RuntimeError on auth failure."""
@@ -97,7 +97,7 @@ def test_raises_on_permanent_error(self, mock_config, mock_client_class):
9797 show_progress = False ,
9898 )
9999
100- @patch ('slicks.discovery.InfluxDBClient3 ' )
100+ @patch ('slicks.fetcher.get_influx_client ' )
101101 @patch ('slicks.discovery.config' )
102102 def test_filters_none_values (self , mock_config , mock_client_class ):
103103 """Should skip None values in the signal name column."""
@@ -128,7 +128,7 @@ def test_filters_none_values(self, mock_config, mock_client_class):
128128
129129 self .assertEqual (result , ["SensorA" ])
130130
131- @patch ('slicks.discovery.InfluxDBClient3 ' )
131+ @patch ('slicks.fetcher.get_influx_client ' )
132132 @patch ('slicks.discovery.config' )
133133 def test_default_chunk_size_is_7_days (self , mock_config , mock_client_class ):
134134 """Default chunk_size_days=7 should produce 2 chunks for 10-day range."""
@@ -152,7 +152,7 @@ def test_default_chunk_size_is_7_days(self, mock_config, mock_client_class):
152152 # 10-day range with 7-day chunks = 2 chunks, each triggers at least 1 query
153153 self .assertGreaterEqual (mock_client .query .call_count , 2 )
154154
155- @patch ('slicks.discovery.InfluxDBClient3 ' )
155+ @patch ('slicks.fetcher.get_influx_client ' )
156156 @patch ('slicks.discovery.config' )
157157 def test_backward_compatible_client_param (self , mock_config , mock_client_class ):
158158 """Passing client= should not raise (backward compat), even though unused."""
0 commit comments