diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-10-21 18:13:33 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-10-21 18:13:33 -0700 |
commit | 72298bcb48e432011d56143525adb642bd18f1d4 (patch) | |
tree | a3b2bcd8538db2ddec5c5ff8a3d623209ef7fc78 /pym/portage/tests/locks/test_asynchronous_lock.py | |
parent | f2d7564b93b4c5387fe82d8a8561b6420c04dee7 (diff) | |
download | portage-72298bcb48e432011d56143525adb642bd18f1d4.tar.gz portage-72298bcb48e432011d56143525adb642bd18f1d4.tar.bz2 portage-72298bcb48e432011d56143525adb642bd18f1d4.zip |
AsynchronousLock: use subprocess if no threads
Diffstat (limited to 'pym/portage/tests/locks/test_asynchronous_lock.py')
-rw-r--r-- | pym/portage/tests/locks/test_asynchronous_lock.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/pym/portage/tests/locks/test_asynchronous_lock.py b/pym/portage/tests/locks/test_asynchronous_lock.py index ac38462ed..7e9fdfec9 100644 --- a/pym/portage/tests/locks/test_asynchronous_lock.py +++ b/pym/portage/tests/locks/test_asynchronous_lock.py @@ -16,14 +16,24 @@ class AsynchronousLockTestCase(TestCase): tempdir = tempfile.mkdtemp() try: path = os.path.join(tempdir, 'lock_me') - for force_thread in (True, False): + for force_async in (True, False): for force_dummy in (True, False): async_lock = AsynchronousLock(path=path, - scheduler=scheduler, _force_dummy=force_dummy, - _force_thread=force_thread) + scheduler=scheduler, _force_async=force_async, + _force_thread=True, + _force_dummy=force_dummy) async_lock.start() async_lock.wait() async_lock.unlock() self.assertEqual(async_lock.returncode, os.EX_OK) + + async_lock = AsynchronousLock(path=path, + scheduler=scheduler, _force_async=force_async, + _force_process=True) + async_lock.start() + async_lock.wait() + async_lock.unlock() + self.assertEqual(async_lock.returncode, os.EX_OK) + finally: shutil.rmtree(tempdir) |