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

Tests - Update test_layer_measurements.py to factory boy setup #158

Open
jomey opened this issue Oct 15, 2024 · 5 comments
Open

Tests - Update test_layer_measurements.py to factory boy setup #158

jomey opened this issue Oct 15, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request tests Any request related to the test suite

Comments

@jomey
Copy link
Member

jomey commented Oct 15, 2024

Change the api/test_layer_measurements.py tests to follow the new test infrastructure introduced with PR #156

@jomey jomey added enhancement New feature or request tests Any request related to the test suite labels Oct 15, 2024
@jomey
Copy link
Member Author

jomey commented Nov 11, 2024

And remove the 'old' db setup:

  • db_connection.py
  • db_setup.py

@aaarendt
Copy link
Contributor

Testing api.py for values greater than or less than returns a type mismatch, due to #159.

I tried this fix at line 158:

        key = k.split("_greater_equal")[0]
        qry = qry.filter(
        cast(getattr(qry_model, key), Numeric) >= v
        )

Which breaks point measurement tests on date ranges.

Looking for ways to cast the cls.MODEL.value as numeric upstream of this, or should we include additional logic to narrow in on this specific case?

@aaarendt
Copy link
Contributor

And remove the 'old' db setup:

  • db_connection.py
  • db_setup.py

Noting that test_conversions.py depends on db_setup.py and has a sequence of conversion tests currently being skipped. So this appears to be a larger chunk of work to redo those tests under our new approach?

@jomey
Copy link
Member Author

jomey commented Nov 25, 2024

And remove the 'old' db setup:

  • db_connection.py
  • db_setup.py

Noting that test_conversions.py depends on db_setup.py and has a sequence of conversion tests currently being skipped. So this appears to be a larger chunk of work to redo those tests under our new approach?

These tests were marked as skipped before the test setup restructure and were marked as such when the DB and API framework were broken up into two repositories. I suggest to simply remove the dependency to DDSetup since they need major refactoring. We should log a separate ticket for this and note that in the test as an open TODO

@aaarendt
Copy link
Contributor

@jomey and I decided to delete the old DBSetup infrastructure and just retain the calls to the credentials file as needed to configure the factories. There is additional work to redo the functions and conversions tests (see #173 and #174).

aaarendt added a commit that referenced this issue Nov 26, 2024
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

No branches or pull requests

2 participants