Skip to content

Commit

Permalink
solved linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DhruvaPatel-crest committed Jan 10, 2025
1 parent f4b67a4 commit 547c239
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions sonatype_nexus/tests/test_api_client.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# (C) Datadog, Inc. 2025-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import unittest
import base64
from unittest.mock import patch, MagicMock

import unittest
from unittest.mock import MagicMock, patch

from datadog_checks.sonatype_nexus.api_client import SonatypeNexusClient


REQUEST_URL = 'requests.Session.get'
URL = 'https://example.com'

@@ -48,13 +46,15 @@ def test_session_headers():
mock_session.return_value.headers.get.side_effect = lambda key: {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": f"Basic {base64.b64encode(f'{instance_check._username}:{instance_check._password}'.encode()).decode('ascii')}",
"Authorization": f"Basic {base64.b64encode(f'{instance_check._username}:{instance_check._password}'\
.encode()).decode('ascii')}",
}.get(key)
session = client.prepare_session()
expected_headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": f"Basic {base64.b64encode(f'{instance_check._username}:{instance_check._password}'.encode()).decode('ascii')}",
"Authorization": f"Basic {base64.b64encode(f'{instance_check._username}:{instance_check._password}'\
.encode()).decode('ascii')}",
}
for key, value in expected_headers.items():
assert session.headers.get(key) == value
2 changes: 1 addition & 1 deletion sonatype_nexus/tests/test_check.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import unittest
from unittest.mock import patch, MagicMock, Mock, call
from unittest.mock import MagicMock, Mock, call, patch

import pytest
import requests
4 changes: 3 additions & 1 deletion sonatype_nexus/tests/test_errors.py
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import unittest
import requests
from unittest.mock import Mock

import requests
from requests import Response

from datadog_checks.sonatype_nexus.errors import APIError, handle_errors


0 comments on commit 547c239

Please sign in to comment.