Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
steveny91 committed Sep 24, 2024
1 parent 27a37c3 commit 0599ce8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dcgm/datadog_checks/dcgm/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under a 3-clause BSD style license (see LICENSE)

from datadog_checks.base import OpenMetricsBaseCheckV2
from datadog_checks.dcgm.metrics import METRIC_MAP, RENAME_LABELS_MAP, IGNORED_TAGS
from datadog_checks.dcgm.metrics import IGNORED_TAGS, METRIC_MAP, RENAME_LABELS_MAP


class DcgmCheck(OpenMetricsBaseCheckV2):
Expand Down
2 changes: 1 addition & 1 deletion dcgm/datadog_checks/dcgm/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@
"kube_namespace:.*",
"pod_name:.*",
"kube_container_name:.*",
]
]
5 changes: 3 additions & 2 deletions dcgm/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ def mock_metrics():
):
yield


@pytest.fixture()
def mock_label_remap():
f_name = os.path.join(os.path.dirname(__file__), 'fixtures', 'label_remap.txt')
with open(f_name, 'r') as f:
text_data = f.read()
with mock.patch(
'requests.get',
return_value=mock.MagicMock(
return_value=mock.MagicMock(
status_code=200, iter_lines=lambda **kwargs: text_data.split("\n"), headers={'Content-Type': "text/plain"}
),
):
yield
yield
1 change: 1 addition & 0 deletions dcgm/tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def test_critical_service_check(dd_run_check, aggregator, mock_http_response, ch
dd_run_check(check)
aggregator.assert_service_check('dcgm.openmetrics.health', status=check.CRITICAL)


@pytest.mark.usefixtures("mock_label_remap")
def test_label_remap(dd_run_check, aggregator, check):
"""
Expand Down

0 comments on commit 0599ce8

Please sign in to comment.