[postprocessor:mtime] add 'value' option (#2739)

This commit is contained in:
bradenhilton
2022-07-08 19:56:01 +01:00
committed by GitHub
parent 90ae48c40c
commit 117eeefda0
3 changed files with 32 additions and 8 deletions

View File

@@ -350,10 +350,6 @@ class MetadataTest(BasePostprocessorTest):
class MtimeTest(BasePostprocessorTest):
def test_mtime_default(self):
pp = self._create()
self.assertEqual(pp.key, "date")
def test_mtime_datetime(self):
self._create(None, {"date": datetime(1980, 1, 1)})
self._trigger()
@@ -364,11 +360,16 @@ class MtimeTest(BasePostprocessorTest):
self._trigger()
self.assertEqual(self.pathfmt.kwdict["_mtime"], 315532800)
def test_mtime_custom(self):
def test_mtime_key(self):
self._create({"key": "foo"}, {"foo": 315532800})
self._trigger()
self.assertEqual(self.pathfmt.kwdict["_mtime"], 315532800)
def test_mtime_value(self):
self._create({"value": "{foo}"}, {"foo": 315532800})
self._trigger()
self.assertEqual(self.pathfmt.kwdict["_mtime"], 315532800)
class ZipTest(BasePostprocessorTest):