anybody help me why cannt see output result of test. Enclosed module code and test file. Thanks a lot and can anybody help me good textbook for python testing for beginners.
#**calculate.py** : #this should be module file
enter code here
class Calculate(object):
def add(self, x, y):
return x + y
if __name__ == '__main__':
calc = Calculate()
result = calc.add(2, 2)
print result
#**calculate_test.py** : #this is test file
import unittest
from app.calculate import Calculate #this is maybe the problem
class TestCalculate(unittest.TestCase):
def setUp(self):
self.calc = Calculate()
def test_add_method_returns_correct_result(self):
self.assertEqual("Hellworld", self.calc.add("Hello",
"World"))
Aucun commentaire:
Enregistrer un commentaire