chore: increment statsd as warn (#23041)

This commit is contained in:
Elizabeth Thompson
2023-02-16 15:43:18 -08:00
committed by GitHub
parent 92b9c06e59
commit 434b445e31
5 changed files with 115 additions and 63 deletions

View File

@@ -90,6 +90,8 @@ def post_assert_metric(
rv = client.post(uri, json=data)
if 200 <= rv.status_code < 400:
mock_method.assert_called_once_with("success", func_name)
elif 400 <= rv.status_code < 500:
mock_method.assert_called_once_with("warning", func_name)
else:
mock_method.assert_called_once_with("error", func_name)
return rv
@@ -455,6 +457,8 @@ class SupersetTestCase(TestCase):
rv = self.client.get(uri)
if 200 <= rv.status_code < 400:
mock_method.assert_called_once_with("success", func_name)
elif 400 <= rv.status_code < 500:
mock_method.assert_called_once_with("warning", func_name)
else:
mock_method.assert_called_once_with("error", func_name)
return rv
@@ -474,6 +478,8 @@ class SupersetTestCase(TestCase):
rv = self.client.delete(uri)
if 200 <= rv.status_code < 400:
mock_method.assert_called_once_with("success", func_name)
elif 400 <= rv.status_code < 500:
mock_method.assert_called_once_with("warning", func_name)
else:
mock_method.assert_called_once_with("error", func_name)
return rv
@@ -501,6 +507,8 @@ class SupersetTestCase(TestCase):
rv = self.client.put(uri, json=data)
if 200 <= rv.status_code < 400:
mock_method.assert_called_once_with("success", func_name)
elif 400 <= rv.status_code < 500:
mock_method.assert_called_once_with("warning", func_name)
else:
mock_method.assert_called_once_with("error", func_name)
return rv