tag:blogger.com,1999:blog-6827527823540310316.post1265211290377740378..comments2023-05-01T08:29:33.624-07:00Comments on .sony: Testing Interactive Codebrandon lewishttp://www.blogger.com/profile/17046865031973847470noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-6827527823540310316.post-41711875787999708082013-09-02T21:09:16.287-07:002013-09-02T21:09:16.287-07:00This is cool!This is cool!Ionahttp://bestmetaldetectorreviews.us/noreply@blogger.comtag:blogger.com,1999:blog-6827527823540310316.post-48591653083475423752010-12-03T01:19:01.531-08:002010-12-03T01:19:01.531-08:00Twisted provides this kind of functionality in the...Twisted provides this kind of functionality in the form of the @inlineCallbacks decorator for generators. It also has some integration with the gtk mainloop and other things. The key innovation that twisted has over your prototype is that it uses iterator.send() to allow constructions like webpage = yield http_get(url). This works by making returns a Deferred object (which can be thought of like a Promise or Future if you've seen the concept in other languages)<br /><br />I am currently using it for the Fargo gateway project, and I have proxy dbus methods that return deferreds (for use with @inlineCallbacks) but I have had to use some slightly more ugly code for turning dbus signals into deferreds that can be waited on.<br /><br />We also use twisted for testing most of our connection-manager code. In this case, we base everything around an event queue, and have a function q.expect(event_pattern) that spins the mainloop until the event is received, or a timeout occurs. In theory, you could make q.expect return a deferred (and I have patches to do so) but if you have a lot of functions that are all using @inlineCallbacks, it adds loads of cruft to your tracebacks (so in the end I dropped those patches on the floor).alsurenhttps://www.blogger.com/profile/10975145212742466082noreply@blogger.comtag:blogger.com,1999:blog-6827527823540310316.post-647145148540524452010-12-02T03:26:51.516-08:002010-12-02T03:26:51.516-08:00Is what a limitation of python? Python has many ar...Is what a limitation of python? Python has many arbitrary limitations, but I'm not sure which you're referring to...brandon lewishttps://www.blogger.com/profile/17046865031973847470noreply@blogger.comtag:blogger.com,1999:blog-6827527823540310316.post-87241143718636886562010-12-01T14:58:18.610-08:002010-12-01T14:58:18.610-08:00I'm 3 semesters away from graduating with a CS...I'm 3 semesters away from graduating with a CS degree and you're not making me look forward to work in the real world!<br /><br />Seriously though, is this a limitation of Python? Would it be better to be programmed in another languaged, such as one that is strongly typed and has better callback features?<br /><br />Just curious/learning.Brett Altonhttp://brettalton.comnoreply@blogger.comtag:blogger.com,1999:blog-6827527823540310316.post-48763039553569981902010-11-29T08:09:47.223-08:002010-11-29T08:09:47.223-08:00I'm aware of both LDTP and Dogtail. I was disa...I'm aware of both LDTP and Dogtail. I was disappointed with both.<br /><br />Moreover, Since PiTiVi is already a python program, it's not like it's really necessary to have an externally testing framework.brandon lewishttps://www.blogger.com/profile/17046865031973847470noreply@blogger.comtag:blogger.com,1999:blog-6827527823540310316.post-20272723062055583862010-11-29T05:55:28.789-08:002010-11-29T05:55:28.789-08:00Redhat uses dogtail[1] for testing all of the gui ...Redhat uses dogtail[1] for testing all of the gui stuff in RHEL and Fedora.<br /><br />[1] https://fedorahosted.org/dogtail/SEJeffhttps://www.blogger.com/profile/11196206407678351694noreply@blogger.comtag:blogger.com,1999:blog-6827527823540310316.post-25778595196165325162010-11-27T01:41:51.777-08:002010-11-27T01:41:51.777-08:00Corrections published.Corrections published.brandon lewishttps://www.blogger.com/profile/17046865031973847470noreply@blogger.comtag:blogger.com,1999:blog-6827527823540310316.post-1642379972406542692010-11-27T01:26:45.103-08:002010-11-27T01:26:45.103-08:00What I wrote about generators was not quite correc...What I wrote about generators was not quite correct. A generator function does not run until it first reaches the yield statement. The following should be sufficient to prove this:<br /><br />In [1]: def foo():<br /> ...: print "bar"<br /> ...: yield<br /> ...: <br /> ...: <br /><br />In [2]: foo()<br />Out[2]: <br /><br />In [3]: foo().next()<br />bar<br /><br />In [4]:brandon lewishttps://www.blogger.com/profile/17046865031973847470noreply@blogger.com