diff options
| author | 2024-06-06 02:40:21 -0400 | |
|---|---|---|
| committer | 2024-06-06 02:40:21 -0400 | |
| commit | ea5caef5825450c5363e358b34cc75dd064c071e (patch) | |
| tree | 041fc10d8f9e370f6f63265071197dc05b922459 /test/test_postprocessor.py | |
| parent | fafdb86c116945de94562112b8958cd9cbf704ef (diff) | |
| parent | 1c28712d865e30ed752988ba0b6944882250b665 (diff) | |
Update upstream source from tag 'upstream/1.27.0'
Update to upstream version '1.27.0'
with Debian dir c97c2a359fc3b8629b579096d65e31f5d6010ce7
Diffstat (limited to 'test/test_postprocessor.py')
| -rw-r--r-- | test/test_postprocessor.py | 18 |
1 files changed, 14 insertions, 4 deletions
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() |
