Added case insensitive filter prefix checks

This commit is contained in:
uclaros 2020-01-18 12:12:03 +02:00 committed by Nyall Dawson
parent 0340aad702
commit b6479c65ae

View File

@ -226,6 +226,11 @@ class TestQgsLocator(unittest.TestCase):
QCoreApplication.processEvents() QCoreApplication.processEvents()
self.assertEqual(got_hit._results_, []) self.assertEqual(got_hit._results_, [])
got_hit._results_ = [] got_hit._results_ = []
l.fetchResults('AaA a', context)
for i in range(100):
sleep(0.002)
QCoreApplication.processEvents()
self.assertEqual(set(got_hit._results_), {'a0', 'a1', 'a2'})
# test with two filters # test with two filters
filter_b = test_filter('b', 'bbb') filter_b = test_filter('b', 'bbb')
@ -278,6 +283,13 @@ class TestQgsLocator(unittest.TestCase):
sleep(0.002) sleep(0.002)
QCoreApplication.processEvents() QCoreApplication.processEvents()
self.assertEqual(set(got_hit._results_), {'custom0', 'custom1', 'custom2'}) self.assertEqual(set(got_hit._results_), {'custom0', 'custom1', 'custom2'})
filter_c.setUseWithoutPrefix(False)
got_hit._results_ = []
l.fetchResults('XyZ b', context)
for i in range(100):
sleep(0.002)
QCoreApplication.processEvents()
self.assertEqual(set(got_hit._results_), {'custom0', 'custom1', 'custom2'})
l.deregisterFilter(filter_c) l.deregisterFilter(filter_c)
del l del l