Conversation
The __repr__ implementation should produce one of:
1. A valid Python string which could be passed to `eval()` to generate
the same object.
2. A string of the form `<{class_name}: {info}>`.
A few of the implementations did not quite adhere to this convention and
have been fixed.
Signed-off-by: JP-Ellis <josh@jpellis.me>
This can be used by other tools to generate coverage reports, or to annotate code within the IDE. Signed-off-by: JP-Ellis <josh@jpellis.me>
This commit adds implementation for all FFI functions which act on an `InteractionHandle`. Most of these map in Python to a method of the `Interaction` class. As the InteractionHandle can point to a HTTP, Sync Message or Async Message Interaction, the initial `Interaction` class has been converted into an abstract class, and then subclassed into three new concrete classes. This will help end-users specifically when it comes to auto-completions within the IDE. Signed-off-by: JP-Ellis <josh@jpellis.me>
520378e to
1bb580e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
This adds implementation for all FFI functions which act on an
InteractionHandle. Most of these map in Python to a method of theInteractionclass.As the InteractionHandle can point to a HTTP, Sync Message or Async Message Interaction, the initial
Interactionclass has been converted into an abstract class, and then subclassed into three new concrete classes. This will help end-users specifically when it comes to auto-completions within the IDE.A couple of minor changes have also been included in this PR in separate commits:
chore(test): automatically generated xml coverage
This can be used by other tools to generate coverage reports, or to annotate code within the IDE.
fix(v3): unconventional repr implementation
The repr implementation should produce one of:
eval()to generate the same object.<{class_name}: {info}>.A few of the implementations did not quite adhere to this convention and have been fixed.
🚨 Breaking ChangesOnly impacting v3 submodule, which makes not stability guarantees.
🔥 Motivation
Part of the development of Pact Python version 3
🔨 Test Plan
Unit tests have been included, with a couple of caveats:
aiohttpand Pact libraries to generate mutually compatible payloads. As this is one of the lesser used feature, I think it is reasonable for have this merged for now and add a ticket to the backlog.SyncMessageInteractionandAsyncMessageInteractionare implemented, but only insofar as to test their instantiation. They are not tested any further.🔗 Related issues/PRs
Interaction#419