Skip to content

Commit 52fa989

Browse files
committed
More tests
1 parent 5cd2518 commit 52fa989

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/src/python/test_qgsfileutils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ def testStringToSafeFilename(self):
6666
def testFindClosestExistingPath(self):
6767
self.assertEqual(QgsFileUtils.findClosestExistingPath(''), '')
6868
self.assertEqual(QgsFileUtils.findClosestExistingPath('.'), '')
69+
self.assertEqual(QgsFileUtils.findClosestExistingPath('just_a_filename'), '')
70+
self.assertEqual(QgsFileUtils.findClosestExistingPath('just_a_filename.txt'), '')
6971
self.assertEqual(QgsFileUtils.findClosestExistingPath('a_very_unlikely_path_to_really_exist/because/no_one_would_have_a_folder_called/MapInfo is the bestest/'), '')
7072
# sorry anyone not on linux!
7173
self.assertEqual(QgsFileUtils.findClosestExistingPath('/usr/youve_been_hacked/by_the_l77t_krew'), '/usr')
@@ -75,9 +77,9 @@ def testFindClosestExistingPath(self):
7577
with open(file, 'wt') as f:
7678
f.write('\n')
7779

78-
self.assertEqual(QgsFileUtils.findClosestExistingPath(os.path.join(base_path, 'a file name.bmp')), base_path) # non-existant file
80+
self.assertEqual(QgsFileUtils.findClosestExistingPath(os.path.join(base_path, 'a file name.bmp')), base_path) # non-existent file
7981
self.assertEqual(QgsFileUtils.findClosestExistingPath(file), base_path) # real file!
80-
self.assertEqual(QgsFileUtils.findClosestExistingPath(os.path.join(base_path, 'non/existant/subfolder')), base_path)
82+
self.assertEqual(QgsFileUtils.findClosestExistingPath(os.path.join(base_path, 'non/existent/subfolder')), base_path)
8183

8284
sub_folder1 = os.path.join(base_path, 'subfolder1')
8385
os.mkdir(sub_folder1)

0 commit comments

Comments
 (0)