test: Fix inconsistent tab/space usage

This is disallowed in Python 3.
test: Convert to Python 3

Change raw_input() to input() and unicode to str. This is *not* compatible with
Python 2.