summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-17 14:14:20 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-17 14:14:20 -0700
commitf94e8ce0c0296cc97ae1a080a21d32c8d23ec2e4 (patch)
tree3aefc7b67791beb19d1d1fd9bd2c7c9000e2f6ce
parent1ffdb3667e18b50e52bbd5c2fa64f5e13a892eb5 (diff)
downloadportage-f94e8ce0c0296cc97ae1a080a21d32c8d23ec2e4.tar.gz
portage-f94e8ce0c0296cc97ae1a080a21d32c8d23ec2e4.tar.bz2
portage-f94e8ce0c0296cc97ae1a080a21d32c8d23ec2e4.zip
test_asynchronous_lock: test returncode more
-rw-r--r--pym/portage/tests/locks/test_asynchronous_lock.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/pym/portage/tests/locks/test_asynchronous_lock.py b/pym/portage/tests/locks/test_asynchronous_lock.py
index dc4619dfd..d592f4b22 100644
--- a/pym/portage/tests/locks/test_asynchronous_lock.py
+++ b/pym/portage/tests/locks/test_asynchronous_lock.py
@@ -23,17 +23,17 @@ class AsynchronousLockTestCase(TestCase):
_force_thread=True,
_force_dummy=force_dummy)
async_lock.start()
- async_lock.wait()
- async_lock.unlock()
+ self.assertEqual(async_lock.wait(), os.EX_OK)
self.assertEqual(async_lock.returncode, os.EX_OK)
+ async_lock.unlock()
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.wait(), os.EX_OK)
self.assertEqual(async_lock.returncode, os.EX_OK)
+ async_lock.unlock()
finally:
shutil.rmtree(tempdir)
@@ -46,6 +46,7 @@ class AsynchronousLockTestCase(TestCase):
lock1 = AsynchronousLock(path=path, scheduler=scheduler)
lock1.start()
self.assertEqual(lock1.wait(), os.EX_OK)
+ self.assertEqual(lock1.returncode, os.EX_OK)
# lock2 requires _force_async=True since the portage.locks
# module is not designed to work as intended here if the
@@ -59,6 +60,7 @@ class AsynchronousLockTestCase(TestCase):
lock1.unlock()
self.assertEqual(lock2.wait(), os.EX_OK)
+ self.assertEqual(lock2.returncode, os.EX_OK)
lock2.unlock()
finally:
shutil.rmtree(tempdir)
@@ -71,6 +73,7 @@ class AsynchronousLockTestCase(TestCase):
lock1 = AsynchronousLock(path=path, scheduler=scheduler)
lock1.start()
self.assertEqual(lock1.wait(), os.EX_OK)
+ self.assertEqual(lock1.returncode, os.EX_OK)
lock2 = AsynchronousLock(path=path, scheduler=scheduler,
_force_async=True, _force_process=True)
lock2.start()
@@ -81,6 +84,7 @@ class AsynchronousLockTestCase(TestCase):
lock2.cancel()
self.assertEqual(lock2.wait() == os.EX_OK, False)
self.assertEqual(lock2.returncode == os.EX_OK, False)
+ self.assertEqual(lock2.returncode is None, False)
lock1.unlock()
finally:
shutil.rmtree(tempdir)