Queer European MD passionate about IT

test_plates.py 836 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. from plates import is_valid
  2. def main():
  3. test_incipit()
  4. test_length()
  5. test_digits()
  6. test_forbidden_characters()
  7. def test_incipit():
  8. assert is_valid('11AA11') == False
  9. assert is_valid('11AA') == False
  10. assert is_valid('1AA2') == False
  11. assert is_valid('2AAP') == False
  12. assert is_valid('A1111') == False
  13. assert is_valid('AA1111') == True
  14. def test_length():
  15. assert is_valid('') == False
  16. assert is_valid('A') == False
  17. assert is_valid('AAAAAA111111') == False
  18. def test_digits():
  19. assert is_valid('AA111A') == False
  20. assert is_valid('AA0111') == False
  21. def test_forbidden_characters():
  22. assert is_valid('AA1.1') == False
  23. assert is_valid('AA1,1') == False
  24. assert is_valid('AA1 1') == False
  25. assert is_valid('AA11!') == False
  26. if __name__ == "__main__":
  27. main()