Ejemplo n.º 1
0
class PersonTests(unittest.TestCase):
    def setUp(self):
        self.p = Person("John", 1986)

    def test_get_name(self):
        self.assertEqual("John", self.p.get_name())

    def test_get_birth_year(self):
        self.assertEqual(1986, self.p.get_year())

    def test_get_age(self):
        self.assertEqual(2014 - 1986, self.p.get_age())

    def test_object_repr(self):
        print(self.p)
Ejemplo n.º 2
0
class PersonTests(unittest.TestCase):
    def setUp(self):
        self.p = Person("John", 1986)

    def test_get_name(self):
        self.assertEqual("John", self.p.get_name())

    def test_get_birth_year(self):
        self.assertEqual(1986, self.p.get_year())

    def test_get_age(self):
        self.assertEqual(2014 - 1986, self.p.get_age())

    def test_object_repr(self):
        print(self.p)