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

TST: Reorganizing testing modules into unit and integration tests #628

Merged
merged 18 commits into from
Jul 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
TST: test_liquidmotor.py reorganization.
lucasfourier committed Jul 3, 2024
commit 769b5754b14f2bc32187b1d5bb4e88cf45e1ff98
32 changes: 32 additions & 0 deletions tests/integration/test_liquidmotor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from unittest.mock import patch

import numpy as np
import pytest
import scipy.integrate

from rocketpy import Function

burn_time = (8, 20)
dry_mass = 10
dry_inertia = (5, 5, 0.2)
center_of_dry_mass = 0
nozzle_position = -1.364
nozzle_radius = 0.069 / 2
pressurant_tank_position = 2.007
fuel_tank_position = -1.048
oxidizer_tank_position = 0.711


@patch("matplotlib.pyplot.show")
def test_liquid_motor_info(mock_show, liquid_motor):
"""Tests the LiquidMotor.all_info() method.
Parameters
----------
mock_show : mock
Mock of the matplotlib.pyplot.show function.
liquid_motor : rocketpy.LiquidMotor
The LiquidMotor object to be used in the tests.
"""
assert liquid_motor.info() == None
assert liquid_motor.all_info() == None
15 changes: 0 additions & 15 deletions tests/test_liquidmotor.py → tests/unit/test_liquidmotor.py
Original file line number Diff line number Diff line change
@@ -17,21 +17,6 @@
oxidizer_tank_position = 0.711


@patch("matplotlib.pyplot.show")
def test_liquid_motor_info(mock_show, liquid_motor):
"""Tests the LiquidMotor.all_info() method.
Parameters
----------
mock_show : mock
Mock of the matplotlib.pyplot.show function.
liquid_motor : rocketpy.LiquidMotor
The LiquidMotor object to be used in the tests.
"""
assert liquid_motor.info() == None
assert liquid_motor.all_info() == None


def test_liquid_motor_basic_parameters(liquid_motor):
"""Tests the LiquidMotor class construction parameters.