def test_method_inheritance(self): repo = Repository("Atk", "1.0") Atk = repo.import_module() klass = Class.from_object(repo, Atk.Plug) self.assertEqual(klass.methods_inherited, [('Atk.Object', 23), ('GObject.Object', 33), ('Atk.Component', 13)])
def test_gio(self): repo = Repository("Gio", "2.0") Gio = repo.import_module() klass = Class.from_object(repo, Gio.Application) method = find(klass.methods, "activate") signal = find(klass.signals, "activate") self.assertTrue(method.info.desc) self.assertTrue(signal.info.desc) self.assertNotEqual(method.info.desc, signal.info.desc) signal = find(klass.signals, "command_line") self.assertTrue(":param command\\_line:" in signal.signature_desc) klass = Class.from_object(repo, Gio.File) method = find(klass.methods, "load_contents_finish") self.assertTrue(":returns:" in method.signature_desc)
def test_atk(self): repo = Repository("Atk", "1.0") Atk = repo.import_module() klass = Class.from_object(repo, Atk.Document) method = find(klass.methods, "get_attributes") self.assertEqual(method.info.version_added, "1.12") method = find(klass.methods, "get_attribute_value") self.assertEqual(method.info.version_added, "1.12") klass = Class.from_object(repo, Atk.Hyperlink) method = find(klass.methods, "is_selected_link") self.assertTrue(method.info.deprecated) self.assertEqual(method.info.version_added, "1.4") self.assertEqual(method.info.version_deprecated, "1.8") self.assertTrue(method.info.deprecation_desc, "1.8")
def test_gtk(self): repo = Repository("Gtk", "3.0") mod = repo.parse() Gtk = repo.import_module() klass = Class.from_object(repo, Gtk.TreeModel) vfunc = find(klass.vfuncs, "do_get_iter") self.assertTrue(vfunc.info.desc) Class.from_object(repo, Gtk.Button) Class.from_object(repo, Gtk.Paned) Class.from_object(repo, Gtk.ActionBar) klass = Class.from_object(repo, Gtk.TextView) self.assertTrue(klass.image_path) find(mod.class_structures, "WidgetClass") find(mod.structures, "TableChild") self.assertRaises(LookupError, find, mod.class_structures, "TableChild") self.assertRaises(LookupError, find, mod.structures, "WidgetClass")
def test_gudev(self): repo = Repository("GUdev", "1.0") GUdev = repo.import_module() Class.from_object(repo, GUdev.Client)
def test_method_inheritance(self): repo = Repository("Atk", "1.0") Atk = repo.import_module() klass = Class.from_object(repo, Atk.Plug) self.assertEqual(klass.methods_inherited, [("Atk.Object", 23), ("GObject.Object", 33), ("Atk.Component", 13)])