test_compat.py 299 B

1234567891011
  1. import pytest
  2. from itsdangerous._compat import _constant_time_compare
  3. @pytest.mark.parametrize(
  4. ("a", "b", "expect"),
  5. ((b"a", b"a", True), (b"a", b"b", False), (b"a", b"aa", False)),
  6. )
  7. def test_python_constant_time_compare(a, b, expect):
  8. assert _constant_time_compare(a, b) == expect