bitly_test.py 569 B

12345678910111213141516
  1. import unittest
  2. from terroroftinytown.services.bitly import Bitly6Service
  3. from terroroftinytown.services.registry import registry
  4. class TestBitly(unittest.TestCase):
  5. def test_registry(self):
  6. self.assertTrue('bitly' in registry)
  7. self.assertTrue('bitly_6' in registry)
  8. def test_6(self):
  9. service = Bitly6Service({'alphabet': '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'})
  10. self.assertEqual('I_H8U0', service.transform_sequence_num(0))
  11. self.assertEqual('FiGaOx', service.transform_sequence_num(10))