'Determines if a response has suitable CORS headers. Appends \'OPTIONS\'
on to the list of verbs.'

def assertCORS(self, res, *verbs, **kw):

    headers = kw.pop('headers', None)
    if (not headers):
        headers = ['X-HTTP-Method-Override', 'Content-Type']
    eq_(res['Access-Control-Allow-Origin'], '*')
    assert ('API-Status' in res['Access-Control-Expose-Headers'])
    assert ('API-Version' in res['Access-Control-Expose-Headers'])
    verbs = (map(str.upper, verbs) + ['OPTIONS'])
    actual = res['Access-Control-Allow-Methods'].split(',    ')
    self.assertSetEqual(verbs, actual)
    eq_(res['Access-Control-Allow-Headers'], ',    '.join(headers))
