summaryrefslogtreecommitdiff
path: root/oslo_concurrency/tests/unit/test_processutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'oslo_concurrency/tests/unit/test_processutils.py')
-rw-r--r--oslo_concurrency/tests/unit/test_processutils.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/oslo_concurrency/tests/unit/test_processutils.py b/oslo_concurrency/tests/unit/test_processutils.py
index b868cb5..0fd8045 100644
--- a/oslo_concurrency/tests/unit/test_processutils.py
+++ b/oslo_concurrency/tests/unit/test_processutils.py
@@ -19,6 +19,7 @@ import errno
import logging
import multiprocessing
import os
+import pickle
import resource
import stat
import subprocess
@@ -467,6 +468,21 @@ grep foo
def test_binary_undecodable_bytes_error(self):
self.check_undecodable_bytes_error(True)
+ def test_picklable(self):
+ exc = processutils.ProcessExecutionError(
+ stdout='my stdout', stderr='my stderr',
+ exit_code=42, cmd='my cmd',
+ description='my description')
+ exc_message = str(exc)
+
+ exc = pickle.loads(pickle.dumps(exc))
+ self.assertEqual('my stdout', exc.stdout)
+ self.assertEqual('my stderr', exc.stderr)
+ self.assertEqual(42, exc.exit_code)
+ self.assertEqual('my cmd', exc.cmd)
+ self.assertEqual('my description', exc.description)
+ self.assertEqual(exc_message, str(exc))
+
class ProcessExecutionErrorLoggingTest(test_base.BaseTestCase):
def setUp(self):