File: test_utils.py

package info (click to toggle)
python-caldav 1.3.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 636 kB
  • sloc: python: 6,824; makefile: 91; sh: 7
file content (16 lines) | stat: -rw-r--r-- 517 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from unittest import TestCase

from caldav.lib.python_utilities import to_wire


class TestUtils(TestCase):
    def test_to_wire(self):
        # fmt: off
        self.assertEqual(to_wire('blatti'), b'blatti')
        self.assertEqual(to_wire(b'blatti'), b'blatti')
        self.assertEqual(to_wire(u'blatti'), b'blatti')
        self.assertEqual(to_wire(''), b'')
        self.assertEqual(to_wire(u''), b'')
        self.assertEqual(to_wire(b''), b'')
        self.assertEqual(to_wire(None), None)
        # fmt: on