/usr/lib/python3/dist-packages/icalendar/tests/test_unit_tools.py is in python3-icalendar 4.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 29 | # -*- coding: utf-8 -*-
import unittest
from icalendar.tools import UIDGenerator
class TestTools(unittest.TestCase):
def test_tools_UIDGenerator(self):
# Automatic semi-random uid
g = UIDGenerator()
uid = g.uid()
txt = uid.to_ical()
length = 15 + 1 + 16 + 1 + 11
self.assertTrue(len(txt) == length)
self.assertTrue(b'@example.com' in txt)
# You should at least insert your own hostname to be more compliant
uid = g.uid('Example.ORG')
txt = uid.to_ical()
self.assertTrue(len(txt) == length)
self.assertTrue(b'@Example.ORG' in txt)
# You can also insert a path or similar
uid = g.uid('Example.ORG', '/path/to/content')
txt = uid.to_ical()
self.assertTrue(len(txt) == length)
self.assertTrue(b'-/path/to/content@Example.ORG' in txt)
|