forked from hbldh/bleak
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize BlueZ device watchers and condition callbacks to avoid linea…
…r searches (hbldh#1400)
- Loading branch information
Showing
4 changed files
with
102 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python | ||
|
||
"""Tests for `bleak.backends.bluezdbus.utils` package.""" | ||
|
||
import pytest | ||
import sys | ||
|
||
|
||
@pytest.mark.skipif( | ||
not sys.platform.startswith("linux"), reason="requires dbus-fast on Linux" | ||
) | ||
def test_device_path_from_characteristic_path(): | ||
"""Test device_path_from_characteristic_path.""" | ||
from bleak.backends.bluezdbus.utils import ( # pylint: disable=import-outside-toplevel | ||
device_path_from_characteristic_path, | ||
) | ||
|
||
assert ( | ||
device_path_from_characteristic_path( | ||
"/org/bluez/hci0/dev_11_22_33_44_55_66/service000c/char000d" | ||
) | ||
== "/org/bluez/hci0/dev_11_22_33_44_55_66" | ||
) |