import io


def build_environ(path):
    """Build WSGI environ for testing.

    It's intentional that some keys and values are unicode instead of bytes, we
    need to support both and this is where we test that.
    """
    return {
        b'REQUEST_METHOD': b'GET',
        b'PATH_INFO': path,
        'QUERY_STRING': '',
        b'SERVER_SOFTWARE': b'build_environ/1.0',
        b'SERVER_PROTOCOL': 'HTTP/1.1',
        'wsgi.input': io.BytesIO(),
    }