def METHOD_NAME(self):
    # Open a gzip in every possible (gzip is binary or "touch" only) way
    # and check if the mode was correctly identified.
    # The lists consist of tuples: filenumber, given mode, identified mode
    # The filenumber must be given because read expects the file to exist
    # and x expects it to NOT exist.
    num_mode_resmode = [
        (0, "a", "ab"),
        (0, "ab", "ab"),
        (0, "w", "wb"),
        (0, "wb", "wb"),
        (1, "x", "xb"),
        (1, "r", "rb"),
        (1, "rb", "rb"),
    ]
    for num, mode, res in num_mode_resmode:
        filename = self.temp(f"test{num}.gz")
        with gzip.GzipFile(filename, mode) as fileobj:
            assert util.fileobj_mode(fileobj) == res