Skip to content

Commit

Permalink
Add a Docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenceKuhl committed Aug 18, 2024
1 parent bac8d73 commit f79b1b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 3 additions & 4 deletions Days/mercedes_universe.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def rare(self) -> bool:
}
return fur[self.fur_color]


class City:
"""Defines a city of inhabitants, all of whom are Creatures"""

Expand All @@ -125,15 +124,14 @@ def remove_inhabitant(self, creature: Creature):

def survey_population(self) -> List[str]:
"""Shows a list of different inhabitants of the city"""
return [f"{creature.name} ({creature.species})" for creature in self.creatures]
return [f"{creature.name}" for creature in self.creatures]

@property
def population_size(self) -> int:
"""returns the size of the population"""
print(len(self.creatures))
return len(self.creatures)


if __name__ == "__main__":
mercy = Creature("Mercy", "F", datetime.datetime(1989, 6, 1))
mercy.speaks("Hey everyone")
Expand All @@ -147,5 +145,6 @@ def population_size(self) -> int:
print(mercy.age)
print(adam.rare())
atlanta.add_inhabitant(adam)
print(adam.city)
print(adam.city.name)
print(atlanta.survey_population())

2 changes: 0 additions & 2 deletions Days/test_creature_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Description: assertions to check for the Creature class
"""
import datetime

import pytest
from mercedes_universe import Creature

Expand All @@ -16,7 +15,6 @@ def mercy_fixture():
"""Create the character Mercy for testing purposes"""
return Creature("Mercy", gender="F", birthday=datetime.datetime(1989, 6, 1))


def test_correctness_of_attributes_(mercy_fixture):
"""Checks the creature function"""
assert mercy_fixture.name == "Mercy"
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM pypy:latest

COPY Days/mercedes_universe.py /

CMD [ "python", "./mercedes_universe.py" ]

0 comments on commit f79b1b2

Please sign in to comment.