Ejemplo n.º 1
0
    def setUp(self) -> None:
        self.person = Person("John", "Lennon")
        self.person2 = Person("Michael", "Jordan")
        self.group = Group("Special", [self.person, self.person2])

        self.p1 = Person("Adam", "Sandal")
        self.p2 = Person("Johann", "Strauss")
        self.p3 = Person("Freddie", "Mercury")
        self.group2 = Group("VIP", [self.p1, self.p2, self.p3])

        self.group3 = self.group + self.group2
Ejemplo n.º 2
0
from project.child import Child
from project.person import Person

person = Person("Peter", 25)
child = Child("Peter Junior", 5)
print(person.name)
print(person.age)
print(child.__class__.__bases__[0].__name__)
Ejemplo n.º 3
0
 def __init__(self, name, age):
     Person.__init__(self, name, age)
Ejemplo n.º 4
0
 def setUp(self) -> None:
     self.person = Person("John", "Lennon")
     self.person2 = Person("Michael", "Jordan")
Ejemplo n.º 5
0
 def test_person(self):
     p = Person()
     res = p.sleep()
     self.assertEqual(res, "sleeping...")
Ejemplo n.º 6
0
from project.person import Person


c = Person('Goshko', 2)
c.make_sound()
print(c.__dict__)