Commit 15074ea8 authored by Denis Bilenko's avatar Denis Bilenko

add greentest/test__order.py for issue #143

parent 7744db20
import gevent
import greentest
class Test(greentest.TestCase):
count = 2
def setUp(self):
self.lst = []
def tearDown(self):
self.assertEqual(self.lst, range(self.count))
def test_greenlet_link(self):
# test that links are executed in the same order as they were added
g = gevent.spawn(self.lst.append, 0)
class appender(object):
def __init__(myself, item):
myself.item = item
def __call__(myself, *args):
self.lst.append(myself.item)
for i in xrange(1, self.count):
g.link(appender(i))
g.join()
class Test3(Test):
count = 3
class Test4(Test):
count = 4
class TestM(Test):
count = 1000
if __name__ == '__main__':
greentest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment