diff --git a/tests/test_util.py b/tests/test_util.py index 5f2e950..cf64c30 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -28,11 +28,21 @@ from typing import List, Sequence, TypeVar import pytest -from secret_handshake.util import bytes_to_long, long_to_bytes, split_chunks +from secret_handshake.util import bytes_to_long, inc_nonce, long_to_bytes, split_chunks T = TypeVar("T") +@pytest.mark.parametrize("in_,out", ((b"\x00\x00\x00\x00", b"\x00" * 23 + b"\x01"),)) +def test_inc_nonce(in_: bytes, out: bytes) -> None: + """Test the inc_nonce function""" + + result = inc_nonce(in_) + + assert len(result) == 24 + assert result == out + + def test_split_chunks_is_generator() -> None: """Test if split_chunks returns a generator"""