Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/animal module - Energy to Mass Conversion #338

Merged
merged 14 commits into from
Nov 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed error in dummy_plants testing.
TaranRallings committed Oct 20, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 39483747cbcf3690c153930f0ca054c260cf8b74
10 changes: 5 additions & 5 deletions tests/models/animals/test_dummy_plants.py
Original file line number Diff line number Diff line change
@@ -8,13 +8,13 @@ class TestPlantCommunity:

@pytest.mark.parametrize(
"initial, final",
[(182000000000.0, 182000000000.0), (10000.0, 19999.999450), (0.0, 0.0)],
[(10000.0, 10000.0), (500.0, 975.0), (0.0, 0.0)],
)
def test_grow(self, plant_instance, initial, final):
"""Testing grow at 100%, 50%, and 0% maximum energy."""
plant_instance.stored_energy = initial
plant_instance.mass_current = initial
plant_instance.grow()
assert plant_instance.stored_energy == pytest.approx(final, rel=1e-6)
assert plant_instance.mass_current == pytest.approx(final, rel=1e-6)

def test_die(self, plant_instance):
"""Testing die."""
@@ -31,12 +31,12 @@ def test_get_eaten(
these tests will be expanded to specific values.
"""

initial_plant_energy = plant_instance.stored_energy
initial_plant_mass = plant_instance.mass_current
initial_decay_pool_energy = excrement_instance.decomposed_energy

# Execution
plant_instance.get_eaten(herbivore_cohort_instance, excrement_instance)

# Assertions
assert plant_instance.stored_energy < initial_plant_energy
assert plant_instance.mass_current < initial_plant_mass
assert excrement_instance.decomposed_energy > initial_decay_pool_energy