Fixed test on Python2.6
Refactored the relative path transformation as its own method, more refactoring needed.