aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-10-22 01:00:14 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2023-10-22 01:00:14 -0400
commite052f3b9e1d9703a5a466daeaf37bacf476c2daf (patch)
treefc608c7d452695706fb13e2b0b34671f569f3ab0 /test
parentb8758ecd073910ce3220b2e68399147b425c37b8 (diff)
New upstream version 1.26.1.upstream/1.26.1
Diffstat (limited to 'test')
-rw-r--r--test/test_extractor.py2
-rw-r--r--test/test_postprocessor.py8
-rw-r--r--test/test_results.py3
3 files changed, 10 insertions, 3 deletions
diff --git a/test/test_extractor.py b/test/test_extractor.py
index 9387f5b..29ccf97 100644
--- a/test/test_extractor.py
+++ b/test/test_extractor.py
@@ -238,7 +238,7 @@ class TestExtractorWait(unittest.TestCase):
until = datetime.fromtimestamp(until)
o = self._isotime_to_seconds(output)
u = self._isotime_to_seconds(until.time().isoformat()[:8])
- self.assertLess(o-u, 1.0)
+ self.assertLessEqual(o-u, 1.0)
@staticmethod
def _isotime_to_seconds(isotime):
diff --git a/test/test_postprocessor.py b/test/test_postprocessor.py
index c00144e..b64df88 100644
--- a/test/test_postprocessor.py
+++ b/test/test_postprocessor.py
@@ -168,7 +168,7 @@ class ExecTest(BasePostprocessorTest):
def test_command_string(self):
self._create({
- "command": "echo {} && rm {};",
+ "command": "echo {} {_path} {_directory} {_filename} && rm {};",
})
with patch("subprocess.Popen") as p:
@@ -178,7 +178,11 @@ class ExecTest(BasePostprocessorTest):
self._trigger(("after",))
p.assert_called_once_with(
- "echo {0} && rm {0};".format(self.pathfmt.realpath), shell=True)
+ "echo {0} {0} {1} {2} && rm {0};".format(
+ self.pathfmt.realpath,
+ self.pathfmt.realdirectory,
+ self.pathfmt.filename),
+ shell=True)
i.wait.assert_called_once_with()
def test_command_list(self):
diff --git a/test/test_results.py b/test/test_results.py
index 4fb22c7..f275bbf 100644
--- a/test/test_results.py
+++ b/test/test_results.py
@@ -201,6 +201,9 @@ class TestExtractorResults(unittest.TestCase):
self.assertEqual(str(value), test[3:], msg=key)
elif test.startswith("type:"):
self.assertEqual(type(value).__name__, test[5:], msg=key)
+ elif test.startswith("len:"):
+ self.assertIsInstance(value, (list, tuple), msg=key)
+ self.assertEqual(len(value), int(test[4:]), msg=key)
else:
self.assertEqual(value, test, msg=key)
else: