-
Notifications
You must be signed in to change notification settings - Fork 216
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
Dynamically Create Plugs and Plug Placeholders #430
Conversation
…lly generating plugs
PTAL |
LGTM |
'required for phase %s' % (name, self.name)) | ||
new_plugs[name] = mutablerecords.CopyRecord(original_plug, cls=sub_class) | ||
return mutablerecords.CopyRecord(self, plugs=new_plugs.values()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@jettisonjoe or @grybmadsci, could either of you take a look today or tomorrow? It's pretty simple and generally accepted, but I'd like at least a cursory review before submitting it :) |
I'll look to tomorrow. I was planning to have one more day of vacation but On Sep 6, 2016 17:26, "Fahrzin Hemmati" [email protected] wrote:
|
For more information on output, see the output.py example. | ||
|
||
with_plugs() is most useful when you have a test that has to happen in the same | ||
(or mostly similar) ways across multiple interfaces, such testing connectivity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
such testing, much wow.
Thanks for the review @grybmadsci! |
] | ||
|
||
test = htf.Test( | ||
*(test_ping.with_args(count=count).with_plugs(pinger=plug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would rather not include .with_args()
in this example. the examples really should introduce exactly one concept and only use mechanisms absolutely required to demonstrate that concept (ie, you need to use plugs to demonstrate .with_plugs()
sensibly). You could remote the whole count
mechanism and make this all a bit simpler.
Pretend I replied "Done" to all comments :) |
@@ -258,10 +275,11 @@ def plug(update_kwargs=True, **plugs): | |||
Raises: | |||
InvalidPlugError: If a type is provided that is not a subclass of BasePlug. | |||
""" | |||
for a_plug in plugs.itervalues(): | |||
if not issubclass(a_plug, BasePlug): | |||
for plug in plugs.itervalues(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't plug
mask the outer symbol function plug
here (ie this function)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh, I was wondering why it was a_plug
before... I looked everywhere but the function I was in :)
LGTM pending nits :) |
Okay, I'll wait for the tests to pass and then submit. Thanks! |
LGTM. Nice example test, too! |
Pushing #406 forward while kdsudac is on vacation