Queer European MD passionate about IT

test_bank.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. from bank import value
  2. def main():
  3. test_lower()
  4. test_upper()
  5. test_title_case()
  6. test_mixed_case()
  7. test_zero()
  8. test_twenty()
  9. test_empty()
  10. test_hundred()
  11. test_containing_hello()
  12. def test_lower():
  13. assert value('hello') == 0
  14. assert value('hey') == 20
  15. assert value('banana') == 100
  16. def test_upper():
  17. assert value('HELLO') == 0
  18. assert value('HEY') == 20
  19. assert value('BANANA') == 100
  20. def test_title_case():
  21. assert value('Hello') == 0
  22. assert value('Hey') == 20
  23. assert value('Banana') == 100
  24. def test_mixed_case():
  25. assert value('Hello') == 0
  26. assert value('Hey') == 20
  27. assert value('Banana') == 100
  28. def test_zero():
  29. assert value('Hello') == 0
  30. assert value('hello') == 0
  31. assert value('HELLO') == 0
  32. assert value('HeLlO') == 0
  33. assert value('hElLo') == 0
  34. def test_twenty():
  35. assert value('Hey') == 20
  36. assert value('hey') == 20
  37. assert value('HEY') == 20
  38. assert value('HeY') == 20
  39. assert value('hEy') == 20
  40. assert value('h') == 20
  41. assert value('h20') == 20
  42. def test_empty():
  43. assert value('') == 100
  44. def test_hundred():
  45. assert value('Banana') == 100
  46. assert value('banana') == 100
  47. assert value('BANANA') == 100
  48. assert value('12345678') == 100
  49. assert value('nothello') == 100
  50. def test_containing_hello():
  51. assert value('aHello') == 100
  52. assert value('ahello') == 100
  53. assert value('aHELLO') == 100
  54. assert value('aHeLlO') == 100
  55. assert value('ahElLo') == 100
  56. if __name__ == "__main__":
  57. main()