File: test_uuid.py

package info (click to toggle)
bleak 2.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,832 kB
  • sloc: python: 10,660; makefile: 165; java: 105
file content (23 lines) | stat: -rw-r--r-- 845 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from bleak.uuids import normalize_uuid_16, normalize_uuid_32, normalize_uuid_str


def test_uuid_length_normalization():
    assert normalize_uuid_str("1801") == "00001801-0000-1000-8000-00805f9b34fb"
    assert normalize_uuid_str("DAF51C01") == "daf51c01-0000-1000-8000-00805f9b34fb"


def test_uuid_case_normalization():
    assert (
        normalize_uuid_str("00001801-0000-1000-8000-00805F9B34FB")
        == "00001801-0000-1000-8000-00805f9b34fb"
    )


def test_uuid_16_normalization():
    assert normalize_uuid_16(0x1801) == "00001801-0000-1000-8000-00805f9b34fb"
    assert normalize_uuid_16(0x1) == "00000001-0000-1000-8000-00805f9b34fb"


def test_uuid_32_normalization():
    assert normalize_uuid_32(0x12345678) == "12345678-0000-1000-8000-00805f9b34fb"
    assert normalize_uuid_32(0x1) == "00000001-0000-1000-8000-00805f9b34fb"