Skip to content

Commit

Permalink
Merge pull request #401 from DataDog/nick/revert_header
Browse files Browse the repository at this point in the history
Revert returning Headers
  • Loading branch information
nmuesch authored Jun 10, 2019
2 parents 3fd82a0 + dac5c40 commit 7fb486f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
6 changes: 0 additions & 6 deletions datadog/api/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def submit(cls, method, path, api_version=None, body=None, attach_host_name=Fals

# Format response content
content = result.content
response_headers = result.headers

if content:
try:
Expand All @@ -156,11 +155,6 @@ def submit(cls, method, path, api_version=None, body=None, attach_host_name=Fals
raise ApiError(response_obj)
else:
response_obj = None

if response_obj:
for response in response_obj:
response['response_headers'] = response_headers

if response_formatter is None:
return response_obj
else:
Expand Down
21 changes: 0 additions & 21 deletions tests/integration/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
FAKE_PROXY = {
"https": "http://user:pass@10.10.1.10:3128/",
}
RATE_LIMIT_HEADERS = ['X-RateLimit-Limit', 'X-RateLimit-Period', 'X-RateLimit-Reset', 'X-RateLimit-Remaining']


class TestDatadog(unittest.TestCase):
Expand Down Expand Up @@ -363,26 +362,6 @@ def test_metrics(self):

dog.Metric.send(metric='matt.metric', points=matt_series, host="matt.metric.host")

@attr("metric")
def test_rate_limit_headers(self):
now = datetime.datetime.now()
now_ts = int(time.mktime(now.timetuple()))
metric_name = "test.metric." + str(now_ts)
host_name = "test.host." + str(now_ts)

dog.Metric.send(metric=metric_name, points=1, host=host_name)
time.sleep(self.wait_time)

metric_query = dog.Metric.query(start=now_ts - 3600, end=now_ts + 3600,
query="avg:%s{host:%s}" % (metric_name, host_name))
assert len(metric_query['series']) == 1, metric_query

headers = metric_query.get('response_headers')
assert headers

for header in RATE_LIMIT_HEADERS:
assert header in headers

def test_type_check(self):
dog.Metric.send(metric="test.metric", points=[(time.time() - 3600, 1.0)])
dog.Metric.send(metric="test.metric", points=1.0)
Expand Down

0 comments on commit 7fb486f

Please sign in to comment.