============================= test session starts =============================
platform win32 -- Python 3.13.3, pytest-9.0.2, pluggy-1.6.0
rootdir: C:\Users\Arvy Kairi\Desktop\whatsapp\pywa
configfile: pyproject.toml
plugins: anyio-4.12.1
collected 6 items

tests\unit\test_signal.py ..FF..                                         [100%]

================================== FAILURES ===================================
__________________________ test_signal_decrypt_pkmsg __________________________

obj = <module 'pywa.protocol.signal_repo' from 'C:\\Users\\Arvy Kairi\\Desktop\\whatsapp\\pywa\\pywa\\protocol\\signal_repo.py'>
name = 'signal_session_decrypt_prekey', ann = 'pywa.protocol.signal_repo'

    def annotated_getattr(obj: object, name: str, ann: str) -> object:
        try:
>           obj = getattr(obj, name)
                  ^^^^^^^^^^^^^^^^^^
E           AttributeError: module 'pywa.protocol.signal_repo' has no attribute 'signal_session_decrypt_prekey'. Did you mean: 'signal_session_encrypt'?

.venv\Lib\site-packages\_pytest\monkeypatch.py:92: AttributeError

The above exception was the direct cause of the following exception:

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x000001CF5AB61A70>

    def test_signal_decrypt_pkmsg(monkeypatch: pytest.MonkeyPatch) -> None:
        def _fake_decrypt_prekey(
            session: bytes,
            identity_private: bytes,
            registration_id: int,
            remote_name: str,
            remote_device: int,
            prekey_id: int | None,
            prekey_private: bytes | None,
            signed_prekey_id: int,
            signed_prekey_private: bytes,
            ciphertext: bytes,
        ):
            assert prekey_id == 123
            assert signed_prekey_id == 456
            assert ciphertext == b"\x33fake_protobuf_body"
            return {"type": "msg", "ciphertext": b"decrypted_payload", "session": b"s1"}
    
>       monkeypatch.setattr("pywa.protocol.signal_repo.signal_session_decrypt_prekey", _fake_decrypt_prekey)

tests\unit\test_signal.py:111: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv\Lib\site-packages\_pytest\monkeypatch.py:106: in derive_importpath
    annotated_getattr(target, attr, ann=module)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

obj = <module 'pywa.protocol.signal_repo' from 'C:\\Users\\Arvy Kairi\\Desktop\\whatsapp\\pywa\\pywa\\protocol\\signal_repo.py'>
name = 'signal_session_decrypt_prekey', ann = 'pywa.protocol.signal_repo'

    def annotated_getattr(obj: object, name: str, ann: str) -> object:
        try:
            obj = getattr(obj, name)
        except AttributeError as e:
>           raise AttributeError(
                f"{type(obj).__name__!r} object at {ann} has no attribute {name!r}"
            ) from e
E           AttributeError: 'module' object at pywa.protocol.signal_repo has no attribute 'signal_session_decrypt_prekey'

.venv\Lib\site-packages\_pytest\monkeypatch.py:94: AttributeError
___________________________ test_signal_decrypt_msg ___________________________

obj = <module 'pywa.protocol.signal_repo' from 'C:\\Users\\Arvy Kairi\\Desktop\\whatsapp\\pywa\\pywa\\protocol\\signal_repo.py'>
name = 'signal_session_decrypt_whisper', ann = 'pywa.protocol.signal_repo'

    def annotated_getattr(obj: object, name: str, ann: str) -> object:
        try:
>           obj = getattr(obj, name)
                  ^^^^^^^^^^^^^^^^^^
E           AttributeError: module 'pywa.protocol.signal_repo' has no attribute 'signal_session_decrypt_whisper'

.venv\Lib\site-packages\_pytest\monkeypatch.py:92: AttributeError

The above exception was the direct cause of the following exception:

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x000001CF5AC1D130>

    def test_signal_decrypt_msg(monkeypatch: pytest.MonkeyPatch) -> None:
        def _fake_decrypt_whisper(
            session: bytes,
            identity_private: bytes,
            registration_id: int,
            remote_name: str,
            remote_device: int,
            ciphertext: bytes,
        ):
            assert session == b"s0"
            return {"type": "msg", "ciphertext": b"whisper_payload", "session": b"s1"}
    
>       monkeypatch.setattr("pywa.protocol.signal_repo.signal_session_decrypt_whisper", _fake_decrypt_whisper)

tests\unit\test_signal.py:143: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv\Lib\site-packages\_pytest\monkeypatch.py:106: in derive_importpath
    annotated_getattr(target, attr, ann=module)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

obj = <module 'pywa.protocol.signal_repo' from 'C:\\Users\\Arvy Kairi\\Desktop\\whatsapp\\pywa\\pywa\\protocol\\signal_repo.py'>
name = 'signal_session_decrypt_whisper', ann = 'pywa.protocol.signal_repo'

    def annotated_getattr(obj: object, name: str, ann: str) -> object:
        try:
            obj = getattr(obj, name)
        except AttributeError as e:
>           raise AttributeError(
                f"{type(obj).__name__!r} object at {ann} has no attribute {name!r}"
            ) from e
E           AttributeError: 'module' object at pywa.protocol.signal_repo has no attribute 'signal_session_decrypt_whisper'

.venv\Lib\site-packages\_pytest\monkeypatch.py:94: AttributeError
=========================== short test summary info ===========================
FAILED tests/unit/test_signal.py::test_signal_decrypt_pkmsg - AttributeError:...
FAILED tests/unit/test_signal.py::test_signal_decrypt_msg - AttributeError: '...
========================= 2 failed, 4 passed in 0.25s =========================
