From 68c5247157e790b574be47d0353710cf853b8828 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 26 Aug 2021 14:42:57 +0200 Subject: tests: Add Python GrlNet test This will crash without the introspection annotation fix in the previous commit. --- tests/python/test_net.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/python/test_net.py diff --git a/tests/python/test_net.py b/tests/python/test_net.py new file mode 100644 index 0000000..acffff6 --- /dev/null +++ b/tests/python/test_net.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +import gi +gi.require_version('GrlNet', '0.3') +from gi.repository import GrlNet +from gi.repository import GLib + +def check_result(wc, res, loop): + loop.quit() + [success, contents] = wc.request_finish(res) + assert(success == True) + +def _init(): + wc = GrlNet.Wc.new() + + loop = GLib.MainLoop() + wc.request_async('https://www.gnome.org/', None, check_result, loop) + loop.run() + +_init() -- cgit v1.2.1