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('error message', 1).args
,
14 self
.assertEqual(svn
.core
.SubversionException('error message', 1).apr_err
,
16 self
.assertEqual(svn
.core
.SubversionException('error message', 1).message
,
19 def test_mime_type_is_binary(self
):
20 self
.assertEqual(0, svn
.core
.svn_mime_type_is_binary("text/plain"))
21 self
.assertEqual(1, svn
.core
.svn_mime_type_is_binary("image/png"))
23 def test_mime_type_validate(self
):
24 self
.assertRaises(svn
.core
.SubversionException
,
25 svn
.core
.svn_mime_type_validate
, "this\nis\ninvalid\n")
26 svn
.core
.svn_mime_type_validate("unknown/but-valid; charset=utf8")
29 return unittest
.makeSuite(SubversionCoreTestCase
, 'test')
31 if __name__
== '__main__':
32 runner
= unittest
.TextTestRunner()