diff options
| author | 2025-05-05 01:19:04 -0400 | |
|---|---|---|
| committer | 2025-05-05 01:19:04 -0400 | |
| commit | 2486bca7db446271312f1fc0f46b032154c65f1b (patch) | |
| tree | 86deb50b258b2dab02936802b79d1af7e3c254ab /test | |
| parent | f98d637baa18530edb64e5f71bb9feefbd9e80b4 (diff) | |
| parent | c679cd7a13bdbf6896e53d68fe2093910bc6625a (diff) | |
Update upstream source from tag 'upstream/1.29.6'
Update to upstream version '1.29.6'
with Debian dir fb955c7c635591b07c8b52773c233ca312089e7a
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_postprocessor.py | 18 | ||||
| -rw-r--r-- | test/test_results.py | 11 |
2 files changed, 27 insertions, 2 deletions
diff --git a/test/test_postprocessor.py b/test/test_postprocessor.py index 8b073b4..76e728c 100644 --- a/test/test_postprocessor.py +++ b/test/test_postprocessor.py @@ -173,6 +173,24 @@ class ClassifyTest(BasePostprocessorTest): self.assertEqual(self.pathfmt.realpath, path + "/file.foo") +class DirectoryTest(BasePostprocessorTest): + + def test_default(self): + self._create() + + path = os.path.join(self.dir.name, "test") + self.assertEqual(self.pathfmt.realdirectory, path + "/") + self.assertEqual(self.pathfmt.realpath, path + "/file.ext") + + self.pathfmt.kwdict["category"] = "custom" + self._trigger() + + path = os.path.join(self.dir.name, "custom") + self.assertEqual(self.pathfmt.realdirectory, path + "/") + self.pathfmt.build_path() + self.assertEqual(self.pathfmt.realpath, path + "/file.ext") + + class ExecTest(BasePostprocessorTest): def test_command_string(self): diff --git a/test/test_results.py b/test/test_results.py index 28db6c3..6e04e1d 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -239,7 +239,11 @@ class TestExtractorResults(unittest.TestCase): key = key[1:] if key not in kwdict: continue + path = "{}.{}".format(parent, key) if parent else key + if key.startswith("!"): + self.assertNotIn(key[1:], kwdict, msg=path) + continue self.assertIn(key, kwdict, msg=path) value = kwdict[key] @@ -272,8 +276,11 @@ class TestExtractorResults(unittest.TestCase): elif test.startswith("type:"): self.assertEqual(test[5:], type(value).__name__, msg=path) elif test.startswith("len:"): - self.assertIsInstance(value, (list, tuple), msg=path) - self.assertEqual(int(test[4:]), len(value), msg=path) + cls, _, length = test[4:].rpartition(":") + if cls: + self.assertEqual( + cls, type(value).__name__, msg=path + "/type") + self.assertEqual(int(length), len(value), msg=path) else: self.assertEqual(test, value, msg=path) else: |
