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

Sequence dispatcher #45

Merged
merged 7 commits into from
Mar 24, 2015
Merged

Sequence dispatcher #45

merged 7 commits into from
Mar 24, 2015

Conversation

radix
Copy link
Contributor

@radix radix commented Mar 24, 2015

Add a SequenceDispatcher dispatcher, which is similar to EQFDispatcher, except that it requires the inputs to be in the order that the intents are actually performed.

This allows meaningful testing of code that performs equal intents multiple times, when the order and sequencing of intents matters.

@cyli
Copy link

cyli commented Mar 24, 2015

Nitpicks:

  1. It might be useful to add another test case for if effects are out of order, as opposed to not in the sequence list at all - I could imagine an implementation where these would pass if SequenceDispatcher behaves just like EqDispatcher.

EDIT: this can probably just adding "hello" as a second item to the sequence passed to the dispatcher in test_mismatch, since in that case "hello" would be in the dispatcher, just not at the top of the list.
2. Would it be useful to document a return value of None if there is no matching sequence? Maybe this is just assumed to be the default behavior if there is no dispatcher for an intent...

@cyli
Copy link

cyli commented Mar 24, 2015

LGTM if travis +1's :)

@radix
Copy link
Contributor Author

radix commented Mar 24, 2015

Thanks very much @cyli!

radix added a commit that referenced this pull request Mar 24, 2015
@radix radix merged commit b9bec55 into master Mar 24, 2015
@radix radix deleted the sequence-dispatcher branch March 24, 2015 22:12
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.

None yet

2 participants