From 1c28712d865e30ed752988ba0b6944882250b665 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Thu, 6 Jun 2024 02:40:15 -0400 Subject: New upstream version 1.27.0. --- test/test_postprocessor.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'test/test_postprocessor.py') diff --git a/test/test_postprocessor.py b/test/test_postprocessor.py index 0ee7cdb..d509052 100644 --- a/test/test_postprocessor.py +++ b/test/test_postprocessor.py @@ -172,7 +172,7 @@ class ExecTest(BasePostprocessorTest): "command": "echo {} {_path} {_directory} {_filename} && rm {};", }) - with patch("subprocess.Popen") as p: + with patch("gallery_dl.util.Popen") as p: i = Mock() i.wait.return_value = 0 p.return_value = i @@ -192,7 +192,7 @@ class ExecTest(BasePostprocessorTest): "\fE _directory.upper()"], }) - with patch("subprocess.Popen") as p: + with patch("gallery_dl.util.Popen") as p: i = Mock() i.wait.return_value = 0 p.return_value = i @@ -212,7 +212,7 @@ class ExecTest(BasePostprocessorTest): "command": "echo {}", }) - with patch("subprocess.Popen") as p: + with patch("gallery_dl.util.Popen") as p: i = Mock() i.wait.return_value = 123 p.return_value = i @@ -230,7 +230,7 @@ class ExecTest(BasePostprocessorTest): "command": "echo {}", }) - with patch("subprocess.Popen") as p: + with patch("gallery_dl.util.Popen") as p: i = Mock() p.return_value = i self._trigger(("after",)) @@ -573,6 +573,16 @@ class MtimeTest(BasePostprocessorTest): self._trigger() self.assertEqual(self.pathfmt.kwdict["_mtime"], 315532800) + def test_mtime_none(self): + self._create(None, {"date": None}) + self._trigger() + self.assertNotIn("_mtime", self.pathfmt.kwdict) + + def test_mtime_undefined(self): + self._create(None, {}) + self._trigger() + self.assertNotIn("_mtime", self.pathfmt.kwdict) + def test_mtime_key(self): self._create({"key": "foo"}, {"foo": 315532800}) self._trigger() -- cgit v1.2.3