-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from agittins/fix-tests
commit 62e3449 (HEAD -> fix-tests, origin/fix-tests) Author: Ashley Gittins <ash@ajg.net.au> Date: Sat Apr 6 16:28:13 2024 +0000 tests: fix tests erroring out - reduce coverage requirement to 43% (now at 43.69%) - add fixture for bluetooth mocking - initial (incomplete) attempt at patching service_infos for options flow - disable for now test for ConfigEntryNotReady exception. commit 683732a Author: Ashley Gittins <ash@ajg.net.au> Date: Fri Apr 5 16:23:06 2024 +0000 Initial improvements to test coverage 40.48% - started at 12% or so.
- Loading branch information
Showing
7 changed files
with
134 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
asyncio_mode = auto |
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 |
---|---|---|
@@ -1,13 +1,38 @@ | ||
"""Constants for Bermuda BLE Trilateration tests.""" | ||
|
||
# AJG: We don't use these vars in our flow. TODO: Add some we _do_ use! | ||
# from custom_components.bermuda.const import ( | ||
# CONF_PASSWORD, | ||
# ) | ||
# from custom_components.bermuda.const import ( | ||
# CONF_USERNAME, | ||
# ) | ||
# MOCK_CONFIG = {CONF_USERNAME: "test_username", CONF_PASSWORD: "test_password"} | ||
from __future__ import annotations | ||
|
||
MOCK_CONFIG = {} | ||
import custom_components.bermuda.const | ||
|
||
# from custom_components.bermuda.const import CONF_DEVICES | ||
# from custom_components.bermuda.const import CONF_MAX_RADIUS | ||
|
||
|
||
MOCK_OPTIONS = { | ||
custom_components.bermuda.const.CONF_MAX_RADIUS: 20.0, | ||
custom_components.bermuda.const.CONF_MAX_VELOCITY: 3.0, | ||
custom_components.bermuda.const.CONF_DEVTRACK_TIMEOUT: 30, | ||
custom_components.bermuda.const.CONF_UPDATE_INTERVAL: 10.0, | ||
custom_components.bermuda.const.CONF_SMOOTHING_SAMPLES: 20, | ||
custom_components.bermuda.const.CONF_ATTENUATION: 3.0, | ||
custom_components.bermuda.const.CONF_REF_POWER: -55.0, | ||
custom_components.bermuda.const.CONF_DEVICES: [], # ["EE:E8:37:9F:6B:54"], | ||
} | ||
|
||
MOCK_CONFIG = {"source": "user"} | ||
|
||
|
||
SERVICE_INFOS = [ | ||
{ | ||
"name": "test device", | ||
"advertisement": {"local_name": "test local name"}, | ||
"device": {"name": "test device name"}, | ||
"address": "EE:E8:37:9F:6B:54", | ||
}, | ||
{ | ||
"name": "test device2", | ||
"advertisement": {"local_name": "test local name2"}, | ||
"device": {"name": "test device name2"}, | ||
"address": "EE:E8:37:9F:6B:56", | ||
}, | ||
] |
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