Queer European MD passionate about IT

test_twttr.py 480 B

123456789101112131415161718192021222324252627282930313233
  1. from twttr import shorten
  2. def main():
  3. test_uppercase()
  4. test_lowercase()
  5. test_null()
  6. test_digits()
  7. test_punctuation()
  8. def test_uppercase():
  9. assert shorten('TWITTER') == 'TWTTR'
  10. def test_lowercase():
  11. assert shorten('twitter') == 'twttr'
  12. def test_null():
  13. assert shorten('') == ''
  14. def test_digits():
  15. assert shorten('abc123') == 'bc123'
  16. def test_punctuation():
  17. assert shorten('abc,') == 'bc,'
  18. if __name__ == "__main__":
  19. main()