Repository: obspy/obspy

Issue:
seedlink basic_client always runs get_info
### Avoid duplicates

- [X] I searched existing issues

### Bug Summary

in clients/seedlink/basic_client.py, Line 132

`if any('*' in x for x in (network, station, location, channel)) \`
 `               or ('?' in x for x in (network, station)):` 
            
always evaluates to true, so self.get_info will be called no matter what.

What's actually needed is:

`if any('*' in x for x in (network, station, location, channel)) \` 
`                 or any('?' in x for x in (network, station)):` 


### Code to Reproduce

_No response_

### Error Traceback

_No response_

### ObsPy Version?

current master

### Operating System?

_No response_

### Python Version?

_No response_

### Installation Method?

None


Discussion:

Resolving patch:
diff --git a/obspy/clients/seedlink/basic_client.py b/obspy/clients/seedlink/basic_client.py
--- a/obspy/clients/seedlink/basic_client.py
+++ b/obspy/clients/seedlink/basic_client.py
@@ -130,7 +130,7 @@ def get_waveforms(self, network, station, location, channel, starttime,
         """
         # need to do an info request?
         if any('*' in x for x in (network, station, location, channel)) \
-                or ('?' in x for x in (network, station)):
+                or any('?' in x for x in (network, station)):
             # need to do an info request on channel level?
             if any('*' in x for x in (location, channel)):
                 info = self.get_info(network=network, station=station,


Test patch:
diff --git a/obspy/clients/seedlink/tests/test_basic_client.py b/obspy/clients/seedlink/tests/test_basic_client.py
--- a/obspy/clients/seedlink/tests/test_basic_client.py
+++ b/obspy/clients/seedlink/tests/test_basic_client.py
@@ -3,6 +3,7 @@
 The obspy.clients.seedlink.basic_client test suite.
 """
 import unittest
+from unittest import mock
 
 import pytest
 
@@ -10,9 +11,7 @@
 from obspy.clients.seedlink.basic_client import Client
 
 
-pytestmark = pytest.mark.network
-
-
+@pytest.mark.network
 class ClientTestCase(unittest.TestCase):
     def setUp(self):
         self.client = Client("rtserver.ipgp.fr")
@@ -108,3 +107,25 @@ def _test_offset_from_realtime(offset):
                 break
         else:
             raise
+
+
+@mock.patch("obspy.clients.seedlink.basic_client.Client._multiselect_request")
+def test_get_waveform_calls_to_get_info(multiselect_mock):
+    """
+    Make sure get_waveforms() without wildcards does not call get_info()
+    Test works without network since connection is only made when
+    multiselect request goes out.
+    """
+    client = Client("abcde")
+    t = UTCDateTime(2000, 1, 1)
+    with mock.patch(
+            "obspy.clients.seedlink.basic_client.Client.get_info") as p:
+        client.get_waveforms("GR", "FUR", "", "HHZ", t, t+1)
+        assert p.call_count == 0
+        # get_info should only be called when wildcards are in SEED ID
+        client.get_waveforms("GR", "?UR", "", "HHZ", t, t+1)
+        assert p.call_count == 1
+        client.get_waveforms("*R", "FUR", "", "HHZ", t, t+1)
+        assert p.call_count == 2
+        client.get_waveforms("GR", "FUR", "", "HH*", t, t+1)
+        assert p.call_count == 3