summaryrefslogtreecommitdiff
path: root/tests/python/test_net.py
blob: acffff6c7b565e02a13ad73f99e13614a80d025b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()