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

Make test for custom ToastActivatedEventArgs dataclass #8

Open
DatGuy1 opened this issue Mar 18, 2022 · 1 comment
Open

Make test for custom ToastActivatedEventArgs dataclass #8

DatGuy1 opened this issue Mar 18, 2022 · 1 comment
Labels
investigation required Extra attention is needed

Comments

@DatGuy1
Copy link
Owner

DatGuy1 commented Mar 18, 2022

Something like this:

def test_activation_args():
    from winsdk.windows.foundation import PropertyValue
    from winsdk.windows.foundation.collections import ValueSet
    from winsdk.windows.ui.notifications import ToastActivatedEventArgs as WinRtToastActivatedEventArgs

    userInput = ValueSet()
    userInput.insert("textBox", PropertyValue.create_string("World, Hello!"))

    rawEventArgs = ValueSet()
    rawEventArgs.insert("arguments", PropertyValue.create_string("test=yes"))
    rawEventArgs.insert("user_input", userInput)

    eventArgs = WinRtToastActivatedEventArgs._from(rawEventArgs)
    parsedArgs = ToastActivatedEventArgs.fromWinRt(eventArgs)

    assert parsedArgs.arguments == "test=yes"
    assert parsedArgs.input == "World, Hello!"

Issue is I don't know what type rawEventArgs should be. The _from(rawEventArgs) statement leads to OSError: [WinError -2147467262] No such interface supported.

@DatGuy1 DatGuy1 added the investigation required Extra attention is needed label Mar 18, 2022
@DatGuy1
Copy link
Owner Author

DatGuy1 commented Jan 29, 2024

Could be solved by pywinrt/pywinrt@d3b5541. Pending wheel release to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation required Extra attention is needed
Projects
Status: Investigation required
Development

No branches or pull requests

1 participant