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

Core tests #119

Merged
merged 11 commits into from
Aug 24, 2023
Merged

Core tests #119

merged 11 commits into from
Aug 24, 2023

Conversation

kilianp14
Copy link
Contributor

  • Added tests for all core modules to achieve 100% branch coverage in vessim.core
  • Some minor bug fixes

@kilianp14 kilianp14 changed the base branch from main to simulated_cacu August 10, 2023 11:30
tests/test_consumer.py Outdated Show resolved Hide resolved
tests/test_consumer.py Outdated Show resolved Hide resolved
Comment on lines +36 to +37
def test_measure(self, power_meter):
assert power_meter.measure() == 20.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does the power meter know which power mode to chose initially? the first in the dict?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initial power mode is "high performance" as specified in the docstring of the MockPowerMeter class

Comment on lines +55 to +58
try:
computing_system.finalize()
except Exception as err:
pytest.fail(f"Unexpected Error: {err}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is being tested here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just a test to check if the finalize function throws an error. I just wrote this test to achieve full code coverage, but I agree that it is not very useful.

@kilianp14 kilianp14 merged commit 6fcf633 into simulated_cacu Aug 24, 2023
@kilianp14 kilianp14 deleted the core_tests branch August 24, 2023 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants