Fix compiler warning due to missing function prototype.
[svn.git] / subversion / bindings / swig / python / tests / core.py
blob00a2ba2727a8720ef772e32b9c53f33275c73121
1 import unittest, os
3 import svn.core
5 class SubversionCoreTestCase(unittest.TestCase):
6 """Test cases for the basic SWIG Subversion core"""
8 def test_SubversionException(self):
9 self.assertEqual(svn.core.SubversionException().args, ())
10 self.assertEqual(svn.core.SubversionException('error message').args,
11 ('error message',))
12 self.assertEqual(svn.core.SubversionException(None, 1).args, (None, 1))
13 self.assertEqual(svn.core.SubversionException('error message', 1).args,
14 ('error message', 1))
15 self.assertEqual(svn.core.SubversionException('error message', 1).apr_err,
17 self.assertEqual(svn.core.SubversionException('error message', 1).message,
18 'error message')
20 def test_mime_type_is_binary(self):
21 self.assertEqual(0, svn.core.svn_mime_type_is_binary("text/plain"))
22 self.assertEqual(1, svn.core.svn_mime_type_is_binary("image/png"))
24 def test_mime_type_validate(self):
25 self.assertRaises(svn.core.SubversionException,
26 svn.core.svn_mime_type_validate, "this\nis\ninvalid\n")
27 svn.core.svn_mime_type_validate("unknown/but-valid; charset=utf8")
29 def suite():
30 return unittest.makeSuite(SubversionCoreTestCase, 'test')
32 if __name__ == '__main__':
33 runner = unittest.TextTestRunner()
34 runner.run(suite())