Queer European MD passionate about IT

test_numb3rs.py 656 B

1234567891011121314151617181920212223242526272829303132
  1. from numb3rs import validate
  2. def main():
  3. test_non_digits()
  4. test_negative_numbers()
  5. test_numbers_too_big()
  6. test_numbers_too_long()
  7. def test_non_digits():
  8. assert validate('aaa.bbb.ccc.ddd') == False
  9. assert validate('cat') == False
  10. def test_negative_numbers():
  11. assert validate('-11.111.-1.-1') == False
  12. def test_numbers_too_big():
  13. assert validate('257.200.1.1') == False
  14. assert validate('200.257.1.1') == False
  15. assert validate('200.1.257.1') == False
  16. assert validate('200.1.5.257') == False
  17. def test_numbers_too_long():
  18. assert validate('200.1.5.2.57') == False
  19. if __name__ == '__main__':
  20. main()