Skip to content

Commit

Permalink
Merging third party branch after cleaning up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
garethr committed Jan 13, 2024
2 parents 47ce10a + d912d10 commit 53ff9ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions snyk/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def _rest_to_v1_response_format(self, project):
"type": attributes.get("type"),
"readOnly": attributes.get("read_only"),
"testFrequency": recurring_tests.get("frequency"),
"lastTestedDate": issue_counts.get("updated_at"),
"isMonitored": True if attributes.get("status") == "active" else False,
"issueCountsBySeverity": {
"low": issue_counts.get("low", 0),
Expand Down
4 changes: 1 addition & 3 deletions snyk/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ class Project(DataClassJSONMixin):
type: str
readOnly: bool
testFrequency: str
lastTestedDate: str
isMonitored: bool
issueCountsBySeverity: IssueCounts
importingUserId: Optional[str] = None
Expand Down Expand Up @@ -643,7 +644,6 @@ def __getattr__(self, item):
# These attributes require us to get the latest snapshot
if item in [
"totalDependencies",
"lastTestedDate",
"imageId",
"imageTag",
"imageBaseImage",
Expand All @@ -652,8 +652,6 @@ def __getattr__(self, item):
snapshot = self._get_project_snapshot()
if item == "totalDependencies":
return snapshot.get("totalDependencies", 0)
elif item == "lastTestedDate":
return snapshot.get("created")
elif item == "imageId":
return snapshot.get("imageId")
elif item == "imageTag":
Expand Down
2 changes: 2 additions & 0 deletions snyk/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def project(self):
"type": "npm",
"readOnly": "false",
"testFrequency": "daily",
"lastTestedDate": "2023-01-13T09:50:54.014Z",
"isMonitored": "true",
"issueCountsBySeverity": {
"critical": 1,
Expand Down Expand Up @@ -348,6 +349,7 @@ def project(self, organization):
readOnly="false",
isMonitored="true",
testFrequency="daily",
lastTestedDate="2023-01-13T09:50:54.014Z",
issueCountsBySeverity={"critical": 1, "low": 8, "high": 13, "medium": 15},
organization=organization,
)
Expand Down

0 comments on commit 53ff9ec

Please sign in to comment.