diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2018-03-19 20:59:05 +0100 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2018-03-19 20:59:05 +0100 |
commit | 104cb87b19cd7ca6dfd641a6862df5095e16de51 (patch) | |
tree | bbfae69a4cdaa3f6ee9fec891a98971d37c47d41 /tests/test_gtype.py | |
parent | 4ca88270f17c1cd72eb91968de2b58fe1c16aa7b (diff) | |
download | pygobject-104cb87b19cd7ca6dfd641a6862df5095e16de51.tar.gz |
tests: improve gtype coverage
Diffstat (limited to 'tests/test_gtype.py')
-rw-r--r-- | tests/test_gtype.py | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/test_gtype.py b/tests/test_gtype.py index 26b7ff58..b9d3349d 100644 --- a/tests/test_gtype.py +++ b/tests/test_gtype.py @@ -51,3 +51,64 @@ class TestTypeModuleLevelFunctions(unittest.TestCase): self.assertEqual(GObject.type_parent(CustomChild), CustomBase.__gtype__) self.assertEqual(GObject.type_parent(CustomBase), GObject.TYPE_OBJECT) self.assertRaises(RuntimeError, GObject.type_parent, GObject.GObject) + + +def test_gtype_has_value_table(): + assert CustomBase.__gtype__.has_value_table() + assert not GIMarshallingTests.Interface.__gtype__.has_value_table() + assert CustomChild.__gtype__.has_value_table() + + +def test_gtype_is_abstract(): + assert not CustomBase.__gtype__.is_abstract() + assert not GIMarshallingTests.Interface.__gtype__.is_abstract() + assert not CustomChild.__gtype__.is_abstract() + + +def test_gtype_is_classed(): + assert CustomBase.__gtype__.is_classed() + assert not GIMarshallingTests.Interface.__gtype__.is_classed() + assert CustomChild.__gtype__.is_classed() + + +def test_gtype_is_deep_derivable(): + assert CustomBase.__gtype__.is_deep_derivable() + assert not GIMarshallingTests.Interface.__gtype__.is_deep_derivable() + assert CustomChild.__gtype__.is_deep_derivable() + + +def test_gtype_is_derivable(): + assert CustomBase.__gtype__.is_derivable() + assert GIMarshallingTests.Interface.__gtype__.is_derivable() + assert CustomChild.__gtype__.is_derivable() + + +def test_gtype_is_value_abstract(): + assert not CustomBase.__gtype__.is_value_abstract() + assert not GIMarshallingTests.Interface.__gtype__.is_value_abstract() + assert not CustomChild.__gtype__.is_value_abstract() + + +def test_gtype_is_value_type(): + assert CustomBase.__gtype__.is_value_type() + assert not GIMarshallingTests.Interface.__gtype__.is_value_type() + assert CustomChild.__gtype__.is_value_type() + + +def test_gtype_children(): + assert CustomBase.__gtype__.children == [CustomChild.__gtype__] + assert GIMarshallingTests.Interface.__gtype__.children == [] + assert CustomChild.__gtype__.children == [] + + +def test_gtype_depth(): + assert CustomBase.__gtype__.depth == 2 + assert GIMarshallingTests.Interface.__gtype__.depth == 2 + assert CustomChild.__gtype__.depth == 3 + + +def test_gtype_interfaces(): + assert CustomBase.__gtype__.interfaces == [] + assert GIMarshallingTests.Interface.__gtype__.interfaces == [] + assert CustomChild.__gtype__.interfaces == \ + [GIMarshallingTests.Interface.__gtype__] |