|
@@ -0,0 +1,32 @@
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+import isc.util.file
|
|
|
+import unittest
|
|
|
+
|
|
|
+class FileTest(unittest.TestCase):
|
|
|
+ def test_search_path_find(self):
|
|
|
+ """Test it returns the first occurence of the file"""
|
|
|
+ self.assertEqual('./file_test.py',
|
|
|
+ isc.util.file.path_search('file_test.py',
|
|
|
+ ['/no/such/directory/', '.',
|
|
|
+ '../tests/']))
|
|
|
+
|
|
|
+ def test_search_path_notfound(self):
|
|
|
+ """Test it throws an exception when the file can't be found"""
|
|
|
+ self.assertRaises(IOError, isc.util.file.path_search, 'no file', ['/no/such/directory'])
|
|
|
+
|
|
|
+if __name__ == "__main__":
|
|
|
+ unittest.main()
|