Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract matter testing utilities to separate module #37309

Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
998c3cc
extract utilities to separate module and mark them in original module…
asirko-soft Jan 29, 2025
54bbb3c
update build file to include utilities
asirko-soft Jan 29, 2025
5e486da
Use UserWarning instead of DeprecationWarning; Add type hint decorato…
asirko-soft Jan 29, 2025
ffb910b
lint code
asirko-soft Jan 29, 2025
95ffa2b
Merge branch 'master' into osirko_api_cleanup_extract-utilities
asirko-soft Jan 30, 2025
7b9c6a6
Merge branch 'master' into osirko_api_cleanup_extract-utilities
asirko-soft Jan 30, 2025
bf7f0db
fix incorrect signatures and return values
asirko-soft Jan 30, 2025
5276e70
adding missing alias and docstrings to utility methods
asirko-soft Jan 30, 2025
39cf68e
fix alias issue
asirko-soft Jan 30, 2025
1bd9b00
just update all the places where moved functiones are used
asirko-soft Jan 31, 2025
12e836b
remove commented out code
asirko-soft Jan 31, 2025
5a1a4fe
using direct aliases as requested in review
asirko-soft Feb 3, 2025
a816491
solit utilities to less general modules
asirko-soft Feb 6, 2025
86a464a
isort
asirko-soft Feb 6, 2025
1480b6e
rename types.py to matchers.py
asirko-soft Feb 6, 2025
7505489
rename type_matches to is_type
asirko-soft Feb 6, 2025
e093a0b
added docstrings and copyright to packages
asirko-soft Feb 6, 2025
5fdbc21
style fix
asirko-soft Feb 6, 2025
bbb911a
isort
asirko-soft Feb 6, 2025
6384035
point test_testing imports to original module for now
asirko-soft Feb 7, 2025
025cc48
add doctest for new modules
asirko-soft Feb 7, 2025
d8fb318
Merge branch 'master' into osirko_api_cleanup_extract-utilities
asirko-soft Feb 7, 2025
e258cde
Merge branch 'master' into osirko_api_cleanup_extract-utilities
asirko-soft Feb 7, 2025
b29c46a
this should fix build error, doctests will run when the module is imp…
asirko-soft Feb 7, 2025
c4c38e5
Merge remote-tracking branch 'upstream/master' into osirko_api_cleanu…
asirko-soft Feb 10, 2025
3b9525d
import modules as modules only; add ToDo to remove aliases in future
asirko-soft Feb 12, 2025
957957a
fix imports
asirko-soft Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix incorrect signatures and return values
  • Loading branch information
asirko-soft committed Jan 30, 2025
commit bf7f0db7b180141b3ea1a31a7a67fb140c1923dd
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ def type_matches(received_value, desired_type):


@_deprecated("utilities")
def utc_time_in_matter_epoch(posix_time_ms: int) -> datetime:
def utc_time_in_matter_epoch(desired_datetime: Optional[datetime] = None):
"""DEPRECATED: Use utilities.utc_time_in_matter_epoch instead"""
return new_utc_time_in_matter_epoch(posix_time_ms)
return new_utc_time_in_matter_epoch(desired_datetime)


@_deprecated("utilities")
Expand All @@ -202,15 +202,15 @@ def utc_datetime_from_posix_time_ms(posix_time_ms: int) -> datetime:


@_deprecated("utilities")
def compare_time(time1: datetime, time2: datetime) -> bool:
def compare_time(received: int, offset: timedelta = timedelta(), utc: Optional[int] = None, tolerance: timedelta = timedelta(seconds=5)) -> None:
"""DEPRECATED: Use utilities.compare_time instead"""
return new_compare_time(time1, time2)
return new_compare_time(received, offset, utc, tolerance)


@_deprecated("utilities")
def get_wait_seconds_from_set_time(set_time: datetime) -> float:
def get_wait_seconds_from_set_time(set_time_matter_us: int, wait_seconds: int):
"""DEPRECATED: Use utilities.get_wait_seconds_from_set_time instead"""
return new_get_wait_seconds_from_set_time(set_time)
return new_get_wait_seconds_from_set_time(set_time_matter_us, wait_seconds)


class SimpleEventCallback:
Expand Down Expand Up @@ -701,13 +701,13 @@ def get_attribute_string(self, cluster_id: int, attribute_id) -> str:


@_deprecated("utilities")
def id_str(id: int) -> str:
def id_str(id):
"""DEPRECATED: Use utilities.id_str instead"""
return new_id_str(id)


@_deprecated("utilities")
def cluster_id_str(id: int) -> str:
def cluster_id_str(id):
"""DEPRECATED: Use utilities.cluster_id_str instead"""
return new_cluster_id_str(id)

Expand Down Expand Up @@ -922,13 +922,13 @@ def stack(self) -> ChipStack:
@_deprecated("utilities")
def bytes_from_hex(hex: str) -> bytes:
"""DEPRECATED: Use utilities.bytes_from_hex instead"""
return new_bytes_from_hex
return new_bytes_from_hex(hex)


@_deprecated("utilities")
def hex_from_bytes(b: bytes) -> str:
"""DEPRECATED: Use utilities.hex_from_bytes instead"""
return new_hex_from_bytes(bytes)
return new_hex_from_bytes(b)


@dataclass
Expand Down
Loading