swap_link first working version
This commit is contained in:
20
test/test_swap_link.py
Normal file
20
test/test_swap_link.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import unittest
|
||||
|
||||
class TestSwapLink(unittest.TestCase):
|
||||
|
||||
data_dir = "test/data/search_test"
|
||||
|
||||
def test_wrong_lnk_file(self):
|
||||
with self.assertRaises(Exception):
|
||||
swap_link(data_dir+"inexistent.txt", data_dir+"/subdir/match1.txt") # inexistent file
|
||||
with self.assertRaises(Exception):
|
||||
swap_link(data_dir+"/subdir1/match1.txt", data_dir+"/subdir/match1.txt") # non link file
|
||||
with self.assertRaises(Exception):
|
||||
swap_link(data_dir+"lnk_dir/ln_valid", data_dir+"/subdir/match1.txt") # not broken link
|
||||
# TODO: no writing permission on file
|
||||
|
||||
def test_wrong_tgt_file(self):
|
||||
# TODO: non-existing target
|
||||
# TODO: target is link to lnk file (can't have 2 symlinks pointing at one another)
|
||||
True
|
||||
|
||||
Reference in New Issue
Block a user