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

Dynamically Create Plugs and Plug Placeholders #430

Merged
merged 13 commits into from
Sep 7, 2016

Conversation

fahhem
Copy link
Collaborator

@fahhem fahhem commented Sep 1, 2016

Pushing #406 forward while kdsudac is on vacation

@fahhem
Copy link
Collaborator Author

fahhem commented Sep 3, 2016

PTAL

@kdsudac
Copy link
Collaborator

kdsudac commented Sep 6, 2016

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())

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@fahhem
Copy link
Collaborator Author

fahhem commented Sep 7, 2016

@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 :)

@jettisonjoe
Copy link
Contributor

I'll look to tomorrow. I was planning to have one more day of vacation but
in fact I'm coming in to work after all.

On Sep 6, 2016 17:26, "Fahrzin Hemmati" [email protected] wrote:

@jettisonjoe https://github.com/jettisonjoe or @grybmadsci
https://github.com/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 :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#430 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHxdltxnZxGauGhA9zt8_TuaXeWzlYCmks5qngSbgaJpZM4JyMir
.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

such testing, much wow.

@fahhem
Copy link
Collaborator Author

fahhem commented Sep 7, 2016

Thanks for the review @grybmadsci!

]

test = htf.Test(
*(test_ping.with_args(count=count).with_plugs(pinger=plug)
Copy link
Collaborator

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.

@fahhem
Copy link
Collaborator Author

fahhem commented Sep 7, 2016

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():
Copy link
Collaborator

@grybmadsci grybmadsci Sep 7, 2016

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)?

Copy link
Collaborator Author

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 :)

@grybmadsci
Copy link
Collaborator

LGTM pending nits :)

@fahhem
Copy link
Collaborator Author

fahhem commented Sep 7, 2016

Okay, I'll wait for the tests to pass and then submit. Thanks!

@jettisonjoe
Copy link
Contributor

LGTM. Nice example test, too!

@fahhem fahhem merged commit 12a54dd into google:master Sep 7, 2016
@fahhem fahhem deleted the create_subclass branch September 7, 2016 22:13
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.

4 participants