Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UP015 (0) #38073

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions Packs/CofenseTriage/Integrations/CofenseTriagev2/CofenseTriagev2.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import demistomock as demisto
from CommonServerPython import *

from io import BytesIO
from PIL import Image
from datetime import datetime
from datetime import timezone
import functools
import itertools
import json
import math
import urllib3
from datetime import datetime, timezone
from io import BytesIO

import demistomock as demisto
import urllib3
from CommonServerPython import *
from PIL import Image
from urllib3.exceptions import InsecureRequestWarning

urllib3.disable_warnings(category=InsecureRequestWarning)

TERSE_FIELDS = [
Expand Down Expand Up @@ -259,7 +258,7 @@ def fetch_report_pages(self):
"page": page_num,
},
)
for page_num in range(0, math.ceil(self.max_pages))
for page_num in range(math.ceil(self.max_pages))
]


Expand Down Expand Up @@ -307,7 +306,7 @@ def fetch_reporters(self):
return itertools.chain.from_iterable(self.fetch_reporter_pages())

def fetch_reporter_pages(self):
for page_num in range(0, math.ceil(self.max_pages)):
for page_num in range(math.ceil(self.max_pages)):
yield self.triage_instance.request(
"reporters", params={"email": self.email, "page": page_num}
)
Expand Down Expand Up @@ -661,9 +660,9 @@ def get_report_by_id_command(triage_instance) -> None:
demisto.results(
{
**report.attachment,
**{

"HumanReadable": "### Cofense HTML Report:\nHTML report download request has been completed"
},
,
}
)
del report_attrs["report_body"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
from unittest.mock import patch

import pytest
from CofenseTriagev2 import TriageInboxReports
from CofenseTriagev2 import TriageReport
from CofenseTriagev2 import TriageReporter
from CofenseTriagev2 import TriageRequestFailedError
from CofenseTriagev2 import TriageNoReportersFoundError
from CofenseTriagev2 import (
TriageInboxReports,
TriageNoReportersFoundError,
TriageReport,
TriageReporter,
TriageRequestFailedError,
)
from freezegun import freeze_time


Expand Down Expand Up @@ -654,7 +656,7 @@
"CofenseTriagev2.TriageReporter"
)

TriageReport.fetch(triage_instance, "6").reporter

Check failure on line 659 in Packs/CofenseTriage/Integrations/CofenseTriagev2/CofenseTriagev2_test.py

View workflow job for this annotation

GitHub Actions / pre-commit / pre-commit

Ruff (B018)

Packs/CofenseTriage/Integrations/CofenseTriagev2/CofenseTriagev2_test.py:659:9: B018 Found useless attribute access. Either assign it to a variable or remove it.

stubbed_triagereporter_init.assert_called_once_with(triage_instance, 5331)

Expand Down
Loading
Loading