Python 2.4 doesn't have ternary ifs :-(

Fix tests for Python 2.4