diff --git a/snyk/managers.py b/snyk/managers.py index e7bafd5..0349504 100644 --- a/snyk/managers.py +++ b/snyk/managers.py @@ -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), diff --git a/snyk/models.py b/snyk/models.py index 55dffad..92a29c3 100644 --- a/snyk/models.py +++ b/snyk/models.py @@ -580,6 +580,7 @@ class Project(DataClassJSONMixin): type: str readOnly: bool testFrequency: str + lastTestedDate: str isMonitored: bool issueCountsBySeverity: IssueCounts importingUserId: Optional[str] = None @@ -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", @@ -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": diff --git a/snyk/test_models.py b/snyk/test_models.py index 2bff89e..fd67ea5 100644 --- a/snyk/test_models.py +++ b/snyk/test_models.py @@ -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, @@ -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, )