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

Update API tests using factories #170

Draft
wants to merge 4 commits into
base: release-0.6.x
Choose a base branch
from
Draft

Conversation

aaarendt
Copy link
Contributor

@aaarendt aaarendt commented Nov 1, 2024

Issue #158

Updates test_layer_measurements.py following the new test infrastructure using factories.
Adds a new factory with real layer density data.

Showing progress so far to ensure I'm on the right track.

@aaarendt aaarendt added enhancement New feature or request tests Any request related to the test suite labels Nov 1, 2024
@aaarendt aaarendt marked this pull request as draft November 1, 2024 17:17
result = clz().all_observers
assert result == ['TEST']
@pytest.fixture
def layer_data(layer_density_factory, db_session):
Copy link
Member

Choose a reason for hiding this comment

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

Suggest of not re-using the same method name within a file and pick something unique (e.g. layer_data_with_density)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I think that is a good call

Copy link
Member

@jomey jomey left a comment

Choose a reason for hiding this comment

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

Looks very good! 🥇

).set_crs("epsg:26912")
result = clz.from_area(
type="density",
shp=df.iloc[0].geometry,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm hesitant to lose these from_area tests, I think it is still important functionality to have safeguards around

Copy link
Member

Choose a reason for hiding this comment

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

Nice catch. I think this test can be transferred over to the new structure.

@micah-prime
Copy link
Contributor

This is looking good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tests Any request related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants