diff options
| author | 2023-01-11 04:09:13 -0500 | |
|---|---|---|
| committer | 2023-01-11 04:09:13 -0500 | |
| commit | fe385c3ff784ba3d19454a35446502c0ec295893 (patch) | |
| tree | 897982793ef2a0c0f349044bf4cf803ccd483e6e /test/test_ytdl.py | |
| parent | ebdfcd3cd3f76534a590ba08933ff7ea54813316 (diff) | |
New upstream version 1.24.3.upstream/1.24.3
Diffstat (limited to 'test/test_ytdl.py')
| -rw-r--r-- | test/test_ytdl.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/test/test_ytdl.py b/test/test_ytdl.py index eedb4f9..a273604 100644 --- a/test/test_ytdl.py +++ b/test/test_ytdl.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2022 Mike Fährmann +# Copyright 2022-2023 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -262,11 +262,21 @@ class Test_CommandlineArguments_YtDlp(Test_CommandlineArguments): def test_metadata_from_title(self): opts = self._(["--metadata-from-title", "%(artist)s - %(title)s"]) + + try: + legacy = (self.module.version.__version__ < "2023.01.01") + except AttributeError: + legacy = True + + actions = [self.module.MetadataFromFieldPP.to_action( + "title:%(artist)s - %(title)s")] + if not legacy: + actions = {"pre_process": actions} + self.assertEqual(opts["postprocessors"][0], { - "key": "MetadataParser", - "when": "pre_process", - "actions": [self.module.MetadataFromFieldPP.to_action( - "title:%(artist)s - %(title)s")], + "key" : "MetadataParser", + "when" : "pre_process", + "actions": actions, }) |
