def test_terraform_request_sequence(self):
    reqs = load_file(os.path.join(os.path.dirname(__file__), 'files', 's3.requests.txt'))
    reqs = reqs.split('---')
    for req in reqs:
        (header, _, body) = req.strip().partition('\n\n')
        (req, _, headers) = header.strip().partition('\n')
        headers = {h.split(':')[0]: h.partition(':')[2].strip() for h in headers.split('\n')}
        (method, path, _) = req.split(' ')
        url = ('%s%s' % (config.get_edge_url(), path))
        result = getattr(requests, method.lower())(url, data=body, headers=headers)
        self.assertLess(result.status_code, 400)
def test_terraform_request_sequence(self):
    reqs = load_file(os.path.join(os.path.dirname(__file__), 'files', 's3.requests.txt'))
    reqs = reqs.split('---')
    for req in reqs:
        (header, _, body) = req.strip().partition('\n\n')
        (req, _, headers) = header.strip().partition('\n')
        headers = {h.split(':')[0]: h.partition(':')[2].strip() for h in headers.split('\n')}
        (method, path, _) = req.split(' ')
        url = ('%s%s' % (config.get_edge_url(), path))
        result = getattr(requests, method.lower())(url, data=body, headers=headers)
        self.assertLess(result.status_code, 400)