Advertisement
Mushi

tdd.py

Apr 30th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. def somar(a, b):
  2.     pass
  3.  
  4. def subtrair(a, b):
  5.     pass
  6.  
  7. def dividir(a, b):
  8.     pass
  9.  
  10. def multiplicar(a, b):
  11.     pass
  12.  
  13. # Testes
  14. def testar_somar(val1, val2, res):
  15.     resultado = somar(val1, val2)
  16.     if resultado == res:
  17.         print("passou")
  18.     else:
  19.         print("não passou")
  20.        
  21. def testar_subtrair(val1, val2, res):
  22.     assert subtrair(val1, val2) == res
  23.  
  24.  
  25. testar_somar(2, 1, 3)
  26. testar_subtrair(5, 4, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement