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
,
12 self
.assertEqual(svn
.core
.SubversionException(None, 1).args
, (None, 1))
13 self
.assertEqual(svn
.core
.SubversionException('error message', 1).args
,
15 self
.assertEqual(svn
.core
.SubversionException('error message', 1).apr_err
,
17 self
.assertEqual(svn
.core
.SubversionException('error message', 1).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")
30 return unittest
.makeSuite(SubversionCoreTestCase
, 'test')
32 if __name__
== '__main__':
33 runner
= unittest
.TextTestRunner()