scanner: Adjust timing for the DirectoryChooserWidget test
Adding a brief sleep when checking main_context iterations gives the widget a chance to update the path so the test can pass more reliably. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
472280ca9b
commit
ea31e1539a
|
@ -1,6 +1,7 @@
|
|||
# Copyright 2021 (c) Anna Schumaker.
|
||||
import db
|
||||
import pathlib
|
||||
import time
|
||||
import unittest
|
||||
from gi.repository import Gio
|
||||
from gi.repository import GLib
|
||||
|
@ -55,7 +56,7 @@ class DirectoryChooserWidget(unittest.TestCase):
|
|||
|
||||
gfile = Gio.File.new_for_path(str(test_subdir))
|
||||
self.assertTrue(dcw.set_file(gfile))
|
||||
while main_context.iteration(may_block=False): pass
|
||||
while main_context.iteration(may_block=False): time.sleep(0.001)
|
||||
self.assertEqual(dcw.selected_path(), test_subdir)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue