tests/test-commandserver.py
branchstable
changeset 14889 a59058fd074a
parent 14882 bb2cffe81a94
child 14939 b4c06b97dfe0
--- a/tests/test-commandserver.py	Fri Jul 15 20:07:19 2011 +0200
+++ b/tests/test-commandserver.py	Sat Jul 09 19:06:59 2011 +0300
@@ -144,6 +144,16 @@
     runcommand(server, ['-R', 'foo', 'showconfig'])
     shutil.rmtree('foo')
 
+def hook(**args):
+    print 'hook talking'
+    print 'now try to read something: %r' % sys.stdin.read()
+
+def hookoutput(server):
+    readchannel(server)
+    runcommand(server, ['--config',
+                        'hooks.pre-identify=python:test-commandserver.hook', 'id'],
+               input=cStringIO.StringIO('some input'))
+
 if __name__ == '__main__':
     os.system('hg init')
 
@@ -158,3 +168,4 @@
     hgrc.write('[ui]\nfoo=bar\n')
     hgrc.close()
     check(localhgrc)
+    check(hookoutput)