Added os.hostname() instead of hardcoded localhost to tests