Revision: 136
Author: psoberoi
Date: Thu May 6 22:46:28 2010
Log: the initial version of this was totally broken in many ways
http://code.google.com/p/iniparse/source/detail?r=136
Modified:
/trunk/tests/test_multiprocessing.py
=======================================
--- /trunk/tests/test_multiprocessing.py Thu May 6 20:26:09 2010
+++ /trunk/tests/test_multiprocessing.py Thu May 6 22:46:28 2010
@@ -7,29 +7,21 @@
from iniparse import compat, ini
-def get_x_dot_y(readfn, writefn):
- cfg = readfn(timeout=3)
- writefn(cfg.x.y)
-
class test_ini(unittest.TestCase):
"""Test sending INIConfig objects."""
def test_queue(self):
+ def getxy(q, w):
+ cfg = q.get_nowait()
+ w.put(cfg.x.y)
cfg = ini.INIConfig()
- cfg.x.y = 42
- q1 = Queue()
- q2 = Queue()
- p = Process(target=get_x_dot_y, args=(q1.get, q2.put))
- q1.put(cfg)
- self.assertEqual(q2.get(timeout=3), 42)
-
- def test_pipe(self):
- cfg = ini.INIConfig()
- cfg.x.y = 42
- c1, c2 = Pipe()
- p = Process(target=get_x_dot_y, args=(c1.recv ,c2.send))
- c1.send(cfg)
- self.assertEqual(c2.recv(timeout=3), 42)
+ cfg.x.y = '42'
+ q = Queue()
+ w = Queue()
+ q.put(cfg)
+ p = Process(target=getxy, args=(q, w))
+ p.start()
+ self.assertEqual(w.get(timeout=1), '42')
class suite(unittest.TestSuite):
def __init__(self):
--
To post to this group, send email to
iniparse...@googlegroups.com
To unsubscribe from this group, send email to
iniparse-commi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/iniparse-commits?hl=en