File: test_auth.py

package info (click to toggle)
ha-philipsjs 3.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 656 kB
  • sloc: python: 13,050; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 392 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13

from haphilipsjs import AUTH_SHARED_KEY, hmac_signature
import pytest

@pytest.mark.parametrize(
    ("timestamp", "auth_key", "pin", "auth_signature"),
    [
        (1128, "um27pghe7wyo0ysu", "0667", "rdPzC+bdWQHQMcwe3X+LddeG/tA=")
    ]
)
async def test_hmac(timestamp, auth_key, pin, auth_signature):
    
    assert hmac_signature(AUTH_SHARED_KEY, str(timestamp), pin) == auth_signature