Thursday, May 17, 2012

Starting Testing GAE Python App with Webtest

Recently I wanted to write automated tests for my GAE WSGI app (the app is written using web2py, but this detail may or may not be relevant to this post). Behavior-driven design, implemented by, e.g., Lettuce, seems to me as an ideal way to write tests---reasons seem to be well-described in this article by Scott Bellware. In python, Webtest is a good way to test WSGI apps. There are a couple of hurdles:

  • it seems that GAE app.yaml cannot be used to get a WSGI app needed to run Webtest-based tests. One get-around for this hurdle is to use WSGIProxy.
  • another (easier) problem is that Webtest redirects stdout and stderr streams, so the print function cannot be used for debugging. This problem can be circumvented using logging

Friday, May 4, 2012

Managing Multiple .bib Files

I am using latex for multiple papers and to merge the contents into a thesis. I have multiple .bib files, say one for each paper. Unluckily, this does not look like a good situation to be in. There should better be only one .bib file that I should use for all the papers, since then I do not need to worry about duplicates; for example, correction of an entry need not be redone if the entry is duplicated in other bib files.

To extract the subset of the consolidated bib file that a particular paper uses, it is possible to use JabRef.  

Here it is also worth to point out that a situation when a cited reference is missing from the bibliography can be detected using the following (assume "make" calls the latex command, namely: latex doc; bibtex doc; latex doc; latex doc):

make | grep -i "warning--" | less

This at best is a hack, but I could not find a better way till now. In particular, there seems to be no easy way to make missing bibentry as an error.  

Backing Up My Ubuntu Desktop Settings and Files

I am using the method at Will shortly need to move my desktop and then I will update how it went.