* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
[svn.git] / subversion / bindings / swig / python / tests / delta.py
blob04ab381df1adcfe504362f03d0bd333db2eb603e
1 import unittest, setup_path
2 import svn.delta
3 import svn.core
4 from cStringIO import StringIO
6 # Test case for svn.delta
7 class DeltaTestCase(unittest.TestCase):
9 def testTxWindowHandler(self):
10 """Test tx_invoke_window_handler"""
11 src_stream = StringIO("hello world");
12 target_stream = StringIO("bye world");
14 # Invoke the window_handler using a helper function
15 window_handler, baton = \
16 svn.delta.tx_apply(src_stream, target_stream, None)
17 svn.delta.tx_invoke_window_handler(window_handler, None, baton)
19 # Invoke the window_handler directly (easier!)
20 window_handler, baton = \
21 svn.delta.tx_apply(src_stream, target_stream, None)
22 window_handler(None, baton)
24 def suite():
25 return unittest.makeSuite(DeltaTestCase, 'test')
27 if __name__ == '__main__':
28 runner = unittest.TextTestRunner()
29 runner.run(suite());