Replaces hardcoded (missing) paths to tempdir with tempdir.mkdtemp()

Replacing hardcoded directory for a temporary directory should make the
tests more platform agnostic and make it easier to run the tests "out of the
box".