File: test_util.py

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

from pytest import raises

from w3lib.util import to_bytes, to_unicode


class ToBytesTestCase(TestCase):
    def test_type_error(self):
        with raises(TypeError):
            to_bytes(True)  # type: ignore


class ToUnicodeTestCase(TestCase):
    def test_type_error(self):
        with raises(TypeError):
            to_unicode(True)  # type: ignore