Changed tests to use tempfile.mkdtemp instead of /tmp