From 59e9ea558c6c312e7544da5dcb99ddde29f08aef Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Wed, 12 Jul 2017 08:45:53 +0900 Subject: Imported Upstream version 3.21.92 Change-Id: I82aba60917e0d0f191abfa37f1162e93981f165d Signed-off-by: DongHun Kwak --- tests/test_gi.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/test_gi.py') diff --git a/tests/test_gi.py b/tests/test_gi.py index 1fbc216..d0c72b6 100644 --- a/tests/test_gi.py +++ b/tests/test_gi.py @@ -710,6 +710,10 @@ class TestFilename(unittest.TestCase): self.assertEqual(result, True) self.assertEqual(contents, b'hello world!\n\x01\x02') + def test_filename_in_nullable(self): + self.assertTrue(GIMarshallingTests.filename_copy(None) is None) + self.assertRaises(TypeError, GIMarshallingTests.filename_exists, None) + def test_filename_out(self): self.assertRaises(GLib.GError, GLib.Dir.make_tmp, 'test') @@ -1265,6 +1269,17 @@ class TestGHashTable(unittest.TestCase): self.assertEqual({'-1': '1', '0': '0', '1': '1'}, GIMarshallingTests.ghashtable_utf8_full_inout(i)) + def test_ghashtable_enum_none_in(self): + GIMarshallingTests.ghashtable_enum_none_in({1: GIMarshallingTests.ExtraEnum.VALUE1, + 2: GIMarshallingTests.ExtraEnum.VALUE2, + 3: GIMarshallingTests.ExtraEnum.VALUE3}) + + def test_ghashtable_enum_none_return(self): + self.assertEqual({1: GIMarshallingTests.ExtraEnum.VALUE1, + 2: GIMarshallingTests.ExtraEnum.VALUE2, + 3: GIMarshallingTests.ExtraEnum.VALUE3}, + GIMarshallingTests.ghashtable_enum_none_return()) + class TestGValue(unittest.TestCase): -- cgit v1.2.3