mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-27 22:11:07 +00:00
29 lines
744 B
Python
29 lines
744 B
Python
from unittest import TestCase
|
|
|
|
from calc import soma, sub, mult, div
|
|
|
|
|
|
class testCalc(TestCase):
|
|
def test_should_return_two_values_sum(self):
|
|
esperado = 1 + 2
|
|
self.assertEqual(esperado, soma(1,2))
|
|
|
|
|
|
def test_should_return_two_values_sub(self):
|
|
esperado = 1 - 2
|
|
self.assertEqual(esperado, sub(1,2))
|
|
|
|
|
|
def test_should_return_two_values_mult(self):
|
|
esperado = 1 * 2
|
|
self.assertEqual(esperado, mult(1,2))
|
|
|
|
def test_should_return_two_values_div(self):
|
|
esperado = 1 / 2
|
|
self.assertEqual(esperado, div(1,2))
|
|
|
|
|
|
def test_should_return_exceptio_on_division_by_zero(self):
|
|
esperado = 'Divisao por zero mal sucedida!!'
|
|
self.assertEqual(esperado, div(1,0))
|