ukBaz / python-bluezero

A simple Python interface to Bluez
MIT License
395 stars 112 forks source link

Tests failing and blocking release #393

Closed ukBaz closed 1 year ago

ukBaz commented 1 year ago

The following tests are failing:

test_scanner_altbeacon (tests.test_observer.TestBlueZ5) ... ERROR
test_scanner_eddy_uid (tests.test_observer.TestBlueZ5) ... ERROR
test_scanner_eddy_url (tests.test_observer.TestBlueZ5) ... ERROR
test_scanner_eddy_url2 (tests.test_observer.TestBlueZ5) ... ERROR
test_scanner_iBeacon (tests.test_observer.TestBlueZ5) ... ERROR
test_on_device_found (tests.test_adapter_example_db_mock.TestAdapterExample) ... ERROR
test_scanner_eddy_url2 (tests.test_eddystone_scanner_example.TestExampleScanner) ... ERROR
test_poll_example (tests.test_microbit_poll_example.TestExampleScanner) ... ERROR

A representative stack trace is given below:

======================================================================
ERROR: test_scanner_eddy_url2 (tests.test_eddystone_scanner_example.TestExampleScanner)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/thinkabit1/PycharmProjects/python-bluezero/tests/test_eddystone_scanner_example.py", line 43, in test_scanner_eddy_url2
    eddystone_scanner.main()
  File "/home/thinkabit1/PycharmProjects/python-bluezero/examples/eddystone_scanner.py", line 15, in main
    observer.scan_eddystone(on_data=print_eddystone_url_values)
  File "/home/thinkabit1/PycharmProjects/python-bluezero/bluezero/observer.py", line 251, in scan_eddystone
    Scanner.start_beacon_scan(on_eddystone_url=on_data)
  File "/home/thinkabit1/PycharmProjects/python-bluezero/bluezero/observer.py", line 235, in start_beacon_scan
    cls.dongle.start_discovery()
  File "/home/thinkabit1/PycharmProjects/python-bluezero/bluezero/adapter.py", line 252, in start_discovery
    self.adapter_methods.StartDiscovery()
  File "/home/thinkabit1/PycharmProjects/python-bluezero/venv/lib/python3.10/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/home/thinkabit1/PycharmProjects/python-bluezero/venv/lib/python3.10/site-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.InvalidArgs: Invalid arguments: More items found in D-Bus signature than in Python arguments

I've wound the git commits back to before #392 (which was the reason for trying to do a release) and the tests still fail. This looks like it is a change in D-Bus or dbusmock that has cause the issue. The functionality itself seems to be working as expected so it appears to be an issue with the tests.

I've spent some time trying to dig in to this and I can't work out what D-Bus signature has more arguments than in Python function.

ukBaz commented 1 year ago

fixed with #398