Commit fcbceede authored by Andrea Azzarone's avatar Andrea Azzarone 🚴

functional-tests: Remove use of deprecated functions

GObject.MainLoop and GObject.timeout_add_seconds are deprecated in favour of
GLib.MainLoop and GLib.timeout_add_seconds.
parent db44aec9
......@@ -20,7 +20,7 @@
"""
Send concurrent inserts and queries to the daemon to check the concurrency.
"""
from gi.repository import GObject
from gi.repository import GLib
import unittest as ut
from common.utils.storetest import CommonTrackerStoreTest as CommonTrackerStoreTest
......@@ -34,7 +34,7 @@ class TestConcurrentQuery (CommonTrackerStoreTest):
holding those queries
"""
def setUp (self):
self.main_loop = GObject.MainLoop ()
self.main_loop = GLib.MainLoop ()
self.mock_data_insert ()
self.finish_counter = 0
......@@ -74,7 +74,7 @@ class TestConcurrentQuery (CommonTrackerStoreTest):
error_handler=self.error_handler)
# Safeguard of 60 seconds. The last reply should quit the loop
GObject.timeout_add_seconds (60, self.timeout_cb)
GLib.timeout_add_seconds (60, self.timeout_cb)
self.main_loop.run ()
def reply_cb (self, obj, results, data):
......
......@@ -22,7 +22,7 @@ Test the query while importing at the same time. This was raising
some SQLITE_MISUSED errors before.
"""
import os
from gi.repository import GObject
from gi.repository import GLib
from common.utils import configuration as cfg
import unittest as ut
......@@ -33,7 +33,7 @@ class TestSqliteMisused (CommonTrackerStoreTest):
Send queries while importing files (in .ttl directory)
"""
def setUp (self):
self.main_loop = GObject.MainLoop ()
self.main_loop = GLib.MainLoop ()
self.files_counter = 0
def test_queries_while_import (self):
......@@ -50,10 +50,10 @@ class TestSqliteMisused (CommonTrackerStoreTest):
error_handler=self.loaded_failed_cb,
user_data = full_path)
GObject.timeout_add_seconds (2, self.run_a_query)
GLib.timeout_add_seconds (2, self.run_a_query)
# Safeguard of 60 seconds. The last reply should quit the loop
# It doesn't matter if we didn't import all of the files yet.
GObject.timeout_add_seconds (60, self.timeout_cb)
GLib.timeout_add_seconds (60, self.timeout_cb)
self.main_loop.run ()
def run_a_query (self):
......
......@@ -22,7 +22,7 @@ Test the query while running BatchSparqlUpdate at the same time. This was raisin
some SQLITE_MISUSED errors before.
"""
import os
from gi.repository import GObject
from gi.repository import GLib
from common.utils import configuration as cfg
import unittest as ut
......@@ -38,7 +38,7 @@ class TestSqliteBatchMisused (CommonTrackerStoreTest):
to configure properly the environment
"""
def setUp (self):
self.main_loop = GObject.MainLoop ()
self.main_loop = GLib.MainLoop ()
self.batch_counter = 0
def test_queries_while_batch_insert (self):
......@@ -70,9 +70,9 @@ class TestSqliteBatchMisused (CommonTrackerStoreTest):
current_batch = ""
self.batch_counter += 1
GObject.timeout_add_seconds (2, self.run_a_query)
GLib.timeout_add_seconds (2, self.run_a_query)
# Safeguard of 60 seconds. The last reply should quit the loop
GObject.timeout_add_seconds (60, self.timeout_cb)
GLib.timeout_add_seconds (60, self.timeout_cb)
self.main_loop.run ()
def run_a_query (self):
......
......@@ -22,7 +22,6 @@ Test that the threads in the daemon are working:
A very long query shouldn't block smaller queries.
"""
import os
from gi.repository import GObject
from gi.repository import GLib
import time
......@@ -44,7 +43,7 @@ class TestThreadedStore (CommonTrackerStoreTest):
Reported in bug NB#183499
"""
def setUp (self):
self.main_loop = GObject.MainLoop ()
self.main_loop = GLib.MainLoop ()
self.simple_queries_counter = AMOUNT_SIMPLE_QUERIES
self.simple_queries_answers = 0
......
......@@ -28,7 +28,6 @@ from common.utils.storetest import CommonTrackerStoreTest as CommonTrackerStoreT
from common.utils import configuration as cfg
from gi.repository import Gio
from gi.repository import GObject
from gi.repository import GLib
import time
......@@ -49,7 +48,7 @@ class TrackerStoreSignalsTests (CommonTrackerStoreTest):
def setUp (self):
self.clean_up_list = []
self.loop = GObject.MainLoop()
self.loop = GLib.MainLoop()
self.timeout_id = 0
self.bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
......
......@@ -19,7 +19,6 @@
#
from gi.repository import Gio
from gi.repository import GLib
from gi.repository import GObject
import os
import sys
import subprocess
......@@ -59,7 +58,7 @@ class Helper:
self.process = None
self.available = False
self.loop = GObject.MainLoop ()
self.loop = GLib.MainLoop ()
self.install_glib_excepthook(self.loop)
self.bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment