Tag Archives: python

Classic Testing vs Design By Contract

Published on: Author: dariusz.cieslak Leave a comment

Automated unit tests are hard to write. Software architecture must be designed carefully to allow unit testing. You have to spend time to write tests as well and it's not easy to write good tests. It's easy to make big mess that is hard to maintain after few weeks. On the other hand automated integration… Continue reading Classic Testing vs Design By Contract

Migration to python subprocess module

Published on: Author: dariusz.cieslak Leave a comment

After recent OS upgrade one of my unit tests started to fail (to be precise it started to hang). Quickly check showed me that CGI process started by os.popen() hanged. The old source code: f = os.popen("./cgi_script.cgi > /dev/null", "w") f.write(postBody) f.flush() f.close() As os.popen() is deprecated now (I know, it's a very old codebase… Continue reading Migration to python subprocess module

Static verificaiton tool for web2py templates

Published on: Author: dariusz.cieslak Leave a comment

Web2Py is a full-stack Python web framework that can be compared to Django, but is easier to learn due to convention-over-explicit-statement preference. In this article I'll check how static verification techniques developed by me for many different environments (JSP, Django templates, TAL, …) can be applied for web2py environment. Static verification means locating simple bugs… Continue reading Static verificaiton tool for web2py templates

Python Web Framework Selection

Published on: Author: dariusz.cieslak Leave a comment

I've been using many different Python Web Frameworks so far: WebStack + mysqldb + custom template framework (long-term ERP project for small company) Django (online shop) CherryPy + Cheetah (online PDF design) Zope (financial) WebStack + SimpleTAL (online PDF design) All frameworks have its strengths and weakness. For new project that will handle appointments using… Continue reading Python Web Framework Selection

How To Migrate Django To Different Database Backend

Published on: Author: dariusz.cieslak 1 Comment

Changing database location is simple – just launch dump on source database server, import it into destination database, redirect domain and voila! You can use this method to migrate your database into newer database engine version. But what can you do if you realize whole backend must be changed (i.e. from MySQL to PostgreSQL)? Migrating… Continue reading How To Migrate Django To Different Database Backend