def get_contents_of_file(path_and_file_name, remove_whitespace):
    """Return the given file contents, formatted for assertion.

    Keyword arguments:
    path_and_file_name -- full path to relevant file
    remove_whitespace -- remove new lines and spaces
    """
    with open(path_and_file_name) as f:
        if remove_whitespace:
            return f.read().replace("\n", "").replace(" ", "")
        else:
            return f.read()