6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-12 14:17:46 +00:00
tutor/tests/test_utils.py
Régis Behmo 6889f6fa90 Add unit tests! yay!
Now, that was seriously missing.
2019-03-23 16:16:44 -07:00

13 lines
499 B
Python

import unittest
from tutor import utils
class UtilsTests(unittest.TestCase):
def test_common_domain(self):
self.assertEqual("domain.com", utils.common_domain("sub1.domain.com", "sub2.domain.com"))
self.assertEqual("sub1.domain.com", utils.common_domain("sub1.domain.com", "sub2.sub1.domain.com"))
self.assertEqual("com", utils.common_domain("domain1.com", "domain2.com"))
self.assertEqual("domain.com", utils.common_domain("sub.domain.com", "ub.domain.com"))