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

Add support for ignoring signal assertion keys #64

Open
mattdodge opened this issue Jan 17, 2019 · 0 comments
Open

Add support for ignoring signal assertion keys #64

mattdodge opened this issue Jan 17, 2019 · 0 comments

Comments

@mattdodge
Copy link
Collaborator

Imagine you had a service that should be publishing signals like this:

{
  "status": "online",
  "timestamp": "Thu Jan 17 09:24:31 PST 2019"
}

It would be useful to assert that the published signal looked correct but getting the timestamp correct on every test run would be difficult. If we could ignore the timestamp key or allow any value there we could make easier assertions. Like this for example:

self.assert_signal_published({
  "status": "online",
  "timestamp": ANY
})

The Python Mock class provides an ANY we could use if we wanted to. It also might be desirable to have that in nested dictionaries.

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

No branches or pull requests

1 participant