'Check headers
param: actual HTTP response object containing headers and status'

def match(self, actual):

    if (('content-length' not in actual) and self._content_length_required(actual)):
        return NonExistentHeader('content-length')
    if ('content-type' not in actual):
        return NonExistentHeader('content-type')
    if ('x-trans-id' not in actual):
        return NonExistentHeader('x-trans-id')
    if ('date' not in actual):
        return NonExistentHeader('date')
    if ((self.method == 'GET') or (self.method == 'HEAD')):
        if ('x-timestamp' not in actual):
            return NonExistentHeader('x-timestamp')
        if ('accept-ranges' not in actual):
            return NonExistentHeader('accept-ranges')
        if (self.target == 'Account'):
            if ('x-account-bytes-used' not in actual):
                return NonExistentHeader('x-account-bytes-used')
            if ('x-account-container-count' not in actual):
                return NonExistentHeader('x-account-container-count')
            if ('x-account-object-count' not in actual):
                return NonExistentHeader('x-account-object-count')
            if (int(actual['x-account-container-count']) > 0):
                acct_header = 'x-account-storage-policy-'
                matched_policy_count = 0
                for policy in self.policies:
                    front_header = (acct_header + policy['name'].lower())
                    usage_policies = [(front_header + '-bytes-used'), (front_header + '-object-count'), (front_header + '-container-count')]
                    policy_hdrs = sum((1 for use_hdr in usage_policies if (use_hdr in actual)))
                    if (policy_hdrs == 3):
                        matched_policy_count = (matched_policy_count + 1)
                    elif ((policy_hdrs > 0) and (policy_hdrs < 3)):
                        for use_hdr in usage_policies:
                            if (use_hdr not in actual):
                                return NonExistentHeader(use_hdr)
                if (self.policies and (matched_policy_count == 0)):
                    return GenericError('No    storage    policy    usage    headers')
        elif (self.target == 'Container'):
            if ('x-container-bytes-used' not in actual):
                return NonExistentHeader('x-container-bytes-used')
            if ('x-container-object-count' not in actual):
                return NonExistentHeader('x-container-object-count')
            if ('x-storage-policy' not in actual):
                return NonExistentHeader('x-storage-policy')
            else:
                policy_name = actual['x-storage-policy']
                for policy in self.policies:
                    if (policy['name'] == policy_name):
                        break
                else:
                    if self.policies:
                        return InvalidHeaderValue('x-storage-policy', policy_name)
        elif (self.target == 'Object'):
            if ('etag' not in actual):
                return NonExistentHeader('etag')
            if ('last-modified' not in actual):
                return NonExistentHeader('last-modified')
    elif (self.method == 'PUT'):
        if (self.target == 'Object'):
            if ('etag' not in actual):
                return NonExistentHeader('etag')
            if ('last-modified' not in actual):
                return NonExistentHeader('last-modified')
    elif (self.method == 'COPY'):
        if (self.target == 'Object'):
            if ('etag' not in actual):
                return NonExistentHeader('etag')
            if ('last-modified' not in actual):
                return NonExistentHeader('last-modified')
            if ('x-copied-from' not in actual):
                return NonExistentHeader('x-copied-from')
            if ('x-copied-from-last-modified' not in actual):
                return NonExistentHeader('x-copied-from-last-modified')
    return None
