File: test_util.py

package info (click to toggle)
python-w3lib 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 388 kB
  • sloc: python: 3,060; makefile: 133
file content (15 lines) | stat: -rw-r--r-- 351 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import pytest

from w3lib.util import to_bytes, to_unicode


class TestToBytes:
    def test_type_error(self):
        with pytest.raises(TypeError):
            to_bytes(True)  # type: ignore[arg-type]


class TestToUnicode:
    def test_type_error(self):
        with pytest.raises(TypeError):
            to_unicode(True)  # type: ignore[arg-type]