Revision 1b8e72f3 lib/rapi/testutils.py

b/lib/rapi/testutils.py
134 134
    return None
135 135

  
136 136

  
137
def _FormatHeaders(headers):
138
  """Formats HTTP headers.
139

  
140
  @type headers: sequence of strings
141
  @rtype: string
142

  
143
  """
144
  assert compat.all(": " in header for header in headers)
145
  return "\n".join(headers)
146

  
147

  
137 148
class FakeCurl:
138 149
  """Fake cURL object.
139 150

  
......
167 178
    writefn = self._opts[pycurl.WRITEFUNCTION]
168 179

  
169 180
    if pycurl.HTTPHEADER in self._opts:
170
      baseheaders = "\n".join(self._opts[pycurl.HTTPHEADER])
181
      baseheaders = _FormatHeaders(self._opts[pycurl.HTTPHEADER])
171 182
    else:
172 183
      baseheaders = ""
173 184

  

Also available in: Unified diff