Skip to content

Strip the IPY_MODEL_ prefix from widget IDs before referencing them. #6377

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

Merged
merged 1 commit into from
Sep 15, 2014

Conversation

jasongrout
Copy link
Member

This was a silly error, probably due to me.

@jasongrout
Copy link
Member Author

@jdfreder, @ellisonbg, ready for review. I can't believe I made this silly mistake.

@jdfreder
Copy link
Contributor

I'm confused, why haven't the child serialization tests been failing in master?

Edit: Would you be able to write a test for this? It seems like an important piece of the code to be untested for regressions.

@jasongrout
Copy link
Member Author

I'd love to write a test. Do you want to write a nose testing framework for the python side of widgets? If I had, say, a mock Comm object that I could plug into a widget, and then send/receive messages on this mock comm instance, it would be easy to test this.

@jasongrout
Copy link
Member Author

By the way, I'm a little confused why this wasn't noticed before too. Perhaps we haven't seen a case where js was sending back a reference to a model?

@jdfreder
Copy link
Contributor

Do you want to write a nose testing framework for the python side of widgets?

As of now, I've been writing these in the CasperJS tests as embedded strings. Each time I need to test something in Python, I run the string as a cell, use Python print, and then use JS to check the output of that cell. It's ugly, painful, and brittle, but it works. 🐴

@jdfreder
Copy link
Contributor

By the way, I'm a little confused why this wasn't noticed before too. Perhaps we haven't seen a case where js was sending back a reference to a model?

Yeah, I guess that makes sense. We must not be echoing back the values after they're sent to the front-end, which is a good thing and is as designed. 😄

@jasongrout
Copy link
Member Author

(just want to make sure this doesn't fall off the table). I'm happy to write a test once we have a framework to test the python side of widgets (I think basically all we need is a mock Comm object). Writing such a framework is on my TODO list, but not near the top :(.

@jdfreder
Copy link
Contributor

Sorry, I was on vacation the past two weeks, I really should have merged this before I had left. I'll open an issue to remind you and/or I to write a test for this (low priority).

jdfreder added a commit that referenced this pull request Sep 15, 2014
Strip the IPY_MODEL_ prefix from widget IDs before referencing them.
@jdfreder jdfreder merged commit d969659 into ipython:master Sep 15, 2014
@jasongrout
Copy link
Member Author

See #6485 for tests

@jasongrout jasongrout deleted the fix-widget-prefix branch September 16, 2014 18:10
@minrk minrk modified the milestone: 3.0 Oct 3, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Strip the IPY_MODEL_ prefix from widget IDs before referencing them.
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.

5 participants