diff options
author | Zac Medico <zmedico@gentoo.org> | 2020-01-23 11:12:49 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2020-01-23 11:28:53 -0800 |
commit | 7c7b1a43285eb93bacc2285207ce8b0bbfd9f9a3 (patch) | |
tree | 3fe9687557d6af87c66d970f6d754457d241f915 | |
parent | Updates for portage-2.3.85 release (diff) | |
download | gentoo-portage-7c7b1a43285eb93bacc2285207ce8b0bbfd9f9a3.tar.xz gentoo-portage-7c7b1a43285eb93bacc2285207ce8b0bbfd9f9a3.zip |
TestSonameAtomPickle: new test for bug 706186
Bug: https://bugs.gentoo.org/706186
Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r-- | lib/portage/tests/dep/test_soname_atom_pickle.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/portage/tests/dep/test_soname_atom_pickle.py b/lib/portage/tests/dep/test_soname_atom_pickle.py new file mode 100644 index 000000000..02965b44f --- /dev/null +++ b/lib/portage/tests/dep/test_soname_atom_pickle.py @@ -0,0 +1,28 @@ +# Copyright 2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +from __future__ import unicode_literals + +import sys + +from portage.dep.soname.SonameAtom import SonameAtom +from portage.tests import TestCase +from portage.util.futures import asyncio +from portage.util.futures.executor.fork import ForkExecutor + + +class TestSonameAtomPickle(TestCase): + + _ALL_PROVIDES = frozenset([SonameAtom('x86_64', 'libc.so.6')]) + + def test_soname_atom_pickle(self): + if sys.version_info < (3,): + self.skipTest('SonameAtom pickle not implemented for python2 (bug 706186)') + loop = asyncio._wrap_loop() + with ForkExecutor(loop=loop) as executor: + result = loop.run_until_complete(loop.run_in_executor(executor, self._get_all_provides)) + self.assertEqual(self._ALL_PROVIDES, result) + + @classmethod + def _get_all_provides(cls): + return cls._ALL_PROVIDES |