File: test_iwscan.py

package info (click to toggle)
comitup 1.43-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,252 kB
  • sloc: python: 3,093; javascript: 1,261; sh: 95; makefile: 34
file content (28 lines) | stat: -rw-r--r-- 495 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright (c) 2022 David Steele <dsteele@gmail.com>
#
# SPDX-License-Identifier: GPL-2.0-or-later
# License-Filename: LICENSE
#

from typing import NamedTuple

import pytest

from comitup.iwscan import decode_x


class Case(NamedTuple):
    instr: str
    outstr: str


@pytest.mark.parametrize(
    "case",
    [
        Case("but", "but"),
        Case("b\xc3\xbct", "büt"),
        Case("b\x00\x00t", "bt"),
    ],
)
def test_decode_x(case):
    assert decode_x(case.instr) == case.outstr