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/templates: Store config in dataclass #1608

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

swick
Copy link
Contributor

@swick swick commented Jan 27, 2025

The templates are loaded onto the MAIN_OBJ which is the same for all
portal impls. That means if a test case sets up multiple templates, they
all operate on the same object.

If we set, for example, `mock.delay` in both templates, the latter will
overwrite the former.

This commit loads the parameters into a dataclass that's available as
mock.${classname}_params.

Technically we have similar issues whenever we access self in the dbus
method implementations, but for the most part we use different variables
in different templates.

depends on #1607

Copy link
Contributor

@whot whot left a comment

Choose a reason for hiding this comment

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

👍

@swick swick force-pushed the wip/test-parameters branch 2 times, most recently from 5df845a to 7d333f4 Compare January 30, 2025 11:22
The templates are loaded onto the MAIN_OBJ which is the same for all
portal impls. That means if a test case sets up multiple templates, they
all operate on the same object.

If we set, for example, `mock.delay` in both templates, the latter will
overwrite the former.

This commit loads the parameters into a dataclass that's available as
mock.${classname}_params.

Technically we have similar issues whenever we access self in the dbus
method implementations, but for the most part we use different variables
in different templates.
@swick swick force-pushed the wip/test-parameters branch from 7d333f4 to 4cf9f95 Compare February 4, 2025 11:42
@GeorgesStavracas GeorgesStavracas added this to the 1.20 milestone Feb 4, 2025
@GeorgesStavracas GeorgesStavracas added the tests Test suite label Feb 4, 2025
@GeorgesStavracas GeorgesStavracas added this pull request to the merge queue Feb 4, 2025
Merged via the queue into flatpak:main with commit 87615db Feb 4, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants