diff --git a/artifactory.py b/artifactory.py index c76925b..709fbdb 100755 --- a/artifactory.py +++ b/artifactory.py @@ -603,6 +603,7 @@ def _get_base_url(self, url): "is_dir", "children", "repo", + "last_updated", ], ) @@ -897,6 +898,7 @@ def stat(self, pathobj): is_dir=is_dir, children=children, repo=jsn.get("repo", None), + last_updated=dateutil.parser.parse(jsn["lastUpdated"]), ) return stat @@ -1585,6 +1587,7 @@ def stat(self, pathobj=None): The following fields are available: ctime -- file creation time mtime -- file modification time + last_updated -- artifact update time created_by -- original uploader modified_by -- last user modifying the file mime_type -- MIME type of the file diff --git a/tests/unit/test_artifactory_path.py b/tests/unit/test_artifactory_path.py index e8d5c69..8a59ba1 100644 --- a/tests/unit/test_artifactory_path.py +++ b/tests/unit/test_artifactory_path.py @@ -498,6 +498,9 @@ def test_stat(self): self.assertEqual( stats.mtime, dateutil.parser.parse("2014-02-24T21:20:36.000+04:00") ) + self.assertEqual( + stats.last_updated, dateutil.parser.parse("2014-02-24T21:20:36.000+04:00") + ) self.assertEqual(stats.created_by, "someuser") self.assertEqual(stats.modified_by, "anotheruser") self.assertEqual(stats.mime_type, "application/octet-stream") @@ -532,6 +535,9 @@ def test_stat(self): self.assertEqual( stats.mtime, dateutil.parser.parse("2014-02-18T15:35:29.361+04:00") ) + self.assertEqual( + stats.last_updated, dateutil.parser.parse("2014-02-18T15:35:29.361+04:00") + ) self.assertEqual(stats.created_by, None) self.assertEqual(stats.modified_by, None) self.assertEqual(stats.mime_type, None) @@ -594,6 +600,9 @@ def test_stat_no_sha256(self): self.assertEqual( stats.mtime, dateutil.parser.parse("2014-02-24T21:20:36.000+04:00") ) + self.assertEqual( + stats.last_updated, dateutil.parser.parse("2014-02-24T21:20:36.000+04:00") + ) self.assertEqual(stats.created_by, "someuser") self.assertEqual(stats.modified_by, "anotheruser") self.assertEqual(stats.mime_type, "application/octet-stream")