Skip to content

Commit 0ca55db

Browse files
More linting
1 parent 624a6d2 commit 0ca55db

4 files changed

Lines changed: 19 additions & 19 deletions

File tree

examples/common/example.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ def load_client_from_profile(
194194
profile = config["profiles"][profile_name]
195195

196196
if "falcon" not in profile:
197-
raise KeyError(
198-
f"Profile '{profile_name}' has no falcon stanza in config.yml"
199-
)
197+
raise KeyError(f"Profile '{profile_name}' has no falcon stanza in config.yml")
200198

201199
_configure_logging(profile)
202200
client = Client(**profile["falcon"])

examples/sensor_download/get_ccid.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ def get_ccid(profile: str):
4444

4545
click.echo(click.style("CID (plain): ", bold=True) + cid)
4646
click.echo(
47-
click.style("CCID (with checksum): ", bold=True)
48-
+ click.style(ccid, fg="green", bold=True)
47+
click.style("CCID (with checksum): ", bold=True) + click.style(ccid, fg="green", bold=True)
4948
)
5049

5150

examples/sensor_download/list_sensor_versions.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,18 @@ def list_sensor_versions(
120120

121121
rows = []
122122
for inst in installers:
123-
rows.append([
124-
inst["platform"],
125-
inst["version"],
126-
inst["os"],
127-
inst.get("os_version") or "—",
128-
inst["release_date"][:10],
129-
", ".join(inst.get("architectures") or []) or "—",
130-
click.style("Yes", fg="green") if inst.get("is_lts") else "No",
131-
inst["sha256"],
132-
])
123+
rows.append(
124+
[
125+
inst["platform"],
126+
inst["version"],
127+
inst["os"],
128+
inst.get("os_version") or "—",
129+
inst["release_date"][:10],
130+
", ".join(inst.get("architectures") or []) or "—",
131+
click.style("Yes", fg="green") if inst.get("is_lts") else "No",
132+
inst["sha256"],
133+
]
134+
)
133135

134136
click.echo(
135137
tabulate(

tests/unit_tests/test_sensor_download.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def test_new_func(mock_oauth2, mock_sensor_download, tmp_path):
8585
return decorator
8686

8787

88-
def mock_get_combined_installers_v3(filter, sort, offset, limit): # pylint: disable=redefined-builtin
88+
def mock_get_combined_installers_v3(
89+
filter, sort, offset, limit
90+
): # pylint: disable=redefined-builtin
8991
return {
9092
"body": {
9193
"resources": mock_installers[offset : offset + limit],
@@ -144,7 +146,7 @@ def test_describe_installers(auth: Client, mock_sensor_download, **_):
144146
"""describe_installers returns a list of all installer metadata dicts."""
145147
auth.sensor_download.sensor_download_api.configure_mock(
146148
**{
147-
"get_combined_sensor_installers_by_query_v3.side_effect": mock_get_combined_installers_v3,
149+
"get_combined_sensor_installers_by_query_v3.side_effect": mock_get_combined_installers_v3, # noqa: E501
148150
}
149151
)
150152

@@ -335,7 +337,7 @@ def test_download_installer_include_version(auth: Client, mock_sensor_download,
335337

336338
@sensor_download_test()
337339
def test_download_installer_file_exists_error(auth: Client, mock_sensor_download, tmp_path, **_):
338-
"""download_installer raises FileExistsError when the file already exists and if_exists='error'."""
340+
"""download_installer raises FileExistsError when the file already exists and if_exists='error'.""" # noqa: E501
339341
existing = tmp_path / mock_installer_linux["name"]
340342
existing.write_bytes(b"old content")
341343

@@ -405,4 +407,3 @@ def test_download_installer_file_exists_overwrite(
405407

406408
assert result == str(existing)
407409
assert existing.read_bytes() == MOCK_CONTENT_LINUX
408-

0 commit comments

Comments
 (0)