[grilo/wip/hadess/net-double-free: 3/4] tests: Add Python GrlNet test




commit 423e911c3ce396a800d0374ee2db2a527639a7ec
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Aug 26 14:42:57 2021 +0200

    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(+)
---
diff --git a/tests/python/test_net.py b/tests/python/test_net.py
new file mode 100644
index 00000000..acffff6c
--- /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()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]