tinyurl_test.py 555 B

12345678910111213141516
  1. import unittest
  2. from terroroftinytown.services.registry import registry
  3. from terroroftinytown.services.tinyurl import Tinyurl7Service
  4. class TestTinyurl(unittest.TestCase):
  5. def test_registry(self):
  6. self.assertTrue('tinyurl' in registry)
  7. self.assertTrue('tinyurl_7' in registry)
  8. def test_7(self):
  9. service = Tinyurl7Service({'alphabet': '0123456789abcdefghijklmnopqrstuvwxyz'})
  10. self.assertEqual('kua854w', service.transform_sequence_num(0))
  11. self.assertEqual('m8o5129', service.transform_sequence_num(10))