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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 from 491f2f6 to 5df845a Compare January 29, 2025 11:12
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 5df845a to 7d333f4 Compare January 30, 2025 11:22
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