From: <kra...@ca...> - 2002-12-16 15:44:36
|
I got pubsub.py to pass 50 of the 55 tests in pubsub_test.cgi. I found a little bug in pubsub.py that broke things pretty thoroughly at first; here's a patch to fix it. --- pubsub.py. Wed Nov 6 01:24:53 2002 +++ pubsub.py Mon Dec 16 07:26:14 2002 @@ -993,7 +993,7 @@ # in places where we're passed just a path, we should not remove self.urlroot; # in places where we're passed an entire URI, we should. (_, _, path, _, _, _) = urlparse.urlparse(uri) - urlroot = "/%s/" % self.urlroot() + urlroot = "/%s" % self.urlroot() if (path == urlroot) or (string.find(path, urlroot + "/")) == 0: path = path[len(urlroot):] return self.server.root_topic.get_descendant(filter(lambda x: x != '', string.split(path, '/'))) def getservername(self): With this fixed, I started the server (with the command line "./pubsub.py 8090 ..", where .. is a literal .., meaning 'the parent directory') and ran the tests by visiting the URL "http://localhost/~kragen/cgi-bin/pubsub_test.cgi?url=http://localhost:8090/kn". The following tests still fail: - content transform: requires off-host posting - evil characters in route-to URL: fails with an error, which is arguably correct behavior; the test expects the route to be created successfully and do nothing instead. - kn_time_t on forwarded HTTP posts: requires off-host posting - replay of events and replay of events with warp factor: replay isn't implemented I looked for the above bug for several hours last night, and apparently I found it in my sleep, because I fixed it within about five minutes this morning. It still doesn't work with any apps, because they all expect to find the topic tree (and the JS microserver) at "../../cgi-bin/pubsub.cgi?do_method=lib", which doesn't work. (It did for a week or two in early 2001, but then I changed pubsub.py to act like the C++ router, not like pubsub.cgi, and use "/kn" instead.) Once I change that back, it might work fine; none of the JavaScript apps depend on any of the features in the failing tests. I'll commit the above change to CVS as soon as I have a chance; I plan to attend the Creative Commons launch party this afternoon, so I may not have time today. -- <kr...@po...> Kragen Sitaker <http://www.pobox.com/~kragen/> Edsger Wybe Dijkstra died in August of 2002. The world has lost a great man. See http://advogato.org/person/raph/diary.html?start=252 and http://www.kode-fu.com/geek/2002_08_04_archive.shtml for details. |