Skip to content
Snippets Groups Projects
Commit 33764eb2 authored by Daniel Rafeh's avatar Daniel Rafeh
Browse files

Delete unittestExample1.py

parent 7ddeafb9
No related branches found
No related tags found
2 merge requests!4Main,!2Main to develop
Pipeline #19922 passed with warnings
import unittest
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def adult(self):
return self.age >= 18
class TestPerson(unittest.TestCase):
def test_if_adult(self):
person1 = Person("Daniel", 24)
person2 = Person("Wasilios", 21)
person3 = Person("Goksis", 12)
self.assertTrue(person1.adult())
self.assertTrue(person2.adult())
self.assertFalse(person3.adult())
if __name__ == "__main__":
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment