summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_utils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
new file mode 100644
index 0000000..c638030
--- /dev/null
+++ b/tests/test_utils.py
@@ -0,0 +1,13 @@
+from unittest import TestCase
+from caldav.lib.python_utilities import to_wire
+
+class TestUtils(TestCase):
+ def test_to_wire(self):
+ 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)
+