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

Some query class / unit tests fixes and enhancements #4163

Merged
merged 5 commits into from
Jul 11, 2021

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented May 28, 2021

My ambitious PRs tend to sit for months on end with no review, often becoming so divergent from the target branch that the conflicts are unresolvable. As a result, I'm trying to submit more, smaller PRs. This is one, containing a first round of tweaks to the project-data query classes and their associated unit tests.

  • Add a unit test for filter(intersect=)
    Also, make the test data slightly more interesting by varying Position values for the clips/transitions in the test data.
  • classes.query: Don't hold a reference to app.project
    By calling get_app() each time we need to access the project data, we delay the lookup until it's needed. As a result, query classes can now be imported even if an application instance has not yet been initialized. (As long as it's initialized before the first call to a query class method).
  • Unit tests:
    • Import query classes at top of file
      (There's no longer any need to delay the imports.)
    • Rename the TestQueryClass class to QueryTests, which is more in line with typical unittest naming
    • Replace explicit TestQueryClass references in the class code with cls or self as appropriate, so any future renaming will be far less of a pain

ferdnyc added 3 commits May 28, 2021 05:57
Also, make the test data slightly more interesting by varying
Position values for the clips/transitions in the test data.
By calling get_app() each time we need to access the project
data, we delay the lookup until it's needed. As a result,
query classes can now be imported even if an application
instance has not been initialized.
ferdnyc added 2 commits June 29, 2021 05:34
- Rename the `TestQueryClass` class to `QueryTests`, which is more
  in keeping with unittest norms.
- Replace all explicit uses of `TestQueryClass` throughout the code
  with `cls` or `self` as appropriate, to eliminate friction
  against any future name changes.
@jonoomph
Copy link
Member

LGTM

@jonoomph jonoomph merged commit 0b4d6e0 into OpenShot:develop Jul 11, 2021
@ferdnyc ferdnyc deleted the test-intersect branch January 7, 2022 02:28
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.

2 participants