search_file break up and test -- not working yet
This commit is contained in:
22
test/test_search_file.py
Normal file
22
test/test_search_file.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import unittest
|
||||
from search_file import search_file
|
||||
|
||||
# TODO: gros TODO icitte. Presque rien de fait!
|
||||
|
||||
class TestSearchFile(unittest.TestCase):
|
||||
|
||||
data_dir = "test/data/search_test"
|
||||
|
||||
def test_print_num_list(self):
|
||||
p = [""]
|
||||
|
||||
|
||||
def test_search_file(self):
|
||||
print(search_file("match1.txt", self.data_dir))
|
||||
with self.assertRaises(FileNotFoundError) as e:
|
||||
search_file("inexistent.txt", self.data_dir)
|
||||
self.assertTrue("File does not exist", e.exception)
|
||||
self.assertEqual(search_file("with space.txt", self.data_dir), "test/data/search_test/subdir2/with space.txt")
|
||||
print(search_file("match2.txt", self.data_dir))
|
||||
print(search_file("subdir2", self.data_dir))
|
||||
|
||||
Reference in New Issue
Block a user