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

Validating pysipp.clien() args at construction time #79

Open
oza4h07 opened this issue May 27, 2022 · 3 comments
Open

Validating pysipp.clien() args at construction time #79

oza4h07 opened this issue May 27, 2022 · 3 comments
Labels

Comments

@oza4h07
Copy link

oza4h07 commented May 27, 2022

Hello,

Using latest pysipp (with sipp 3.5.2):

import pysipp
uac = pysipp.client(invalid_arg='foo')

Is there a way to trigger an error or warning when passing an invalid argument ?
Best regards

@goodboy
Copy link
Member

goodboy commented May 27, 2022

Ahh good catch. Yeah we should probably have an arg validator 😂

I'm kind of surprised this doesn't error.

@oza4h07 would you mind writing a simple test for this and then we can get a patch in?

@goodboy goodboy added the bug label May 27, 2022
@oza4h07
Copy link
Author

oza4h07 commented May 30, 2022

I'll try to write such test in the coming days ...
Thanks for looking at this !

@goodboy
Copy link
Member

goodboy commented May 30, 2022

@oza4h07 no problema amigo.

I think our main issue is going to be that all the option keys are currently defined inside strings in our sipp_spec: list[Union[str, Field]] thing.

Looking at the code it seems like it should already be raising an error:

I would try adjusting line 121 to be above line 119 and see if that catches this.
Only question is if it will break everything else 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants