예제 #1
0
 def test_cat(self):
     a = Cat()
     self.assertEqual(a.meow(), "meowing...")
     self.assertEqual(a.__class__.__bases__[0].__name__, "Animal")
예제 #2
0
from project.animal import Animal
from project.dog import Dog
from project.cat import Cat

animal = Animal()
dog = Dog()
cat = Cat()

print(animal.eat())
print(dog.eat(), dog.bark())
print(cat.eat(), cat.meow())
예제 #3
0
from project.animal import Animal
from project.cat import Cat
from project.dog import Dog

animal = Animal()
print(animal.eat())

dog = Dog()
print(dog.bark())
print(dog.eat())

cat = Cat()
print(cat.meow())
print(cat.eat())
예제 #4
0
from project.cat import Cat

c = Cat()
print(c.meow())
print(c.eat())