Phase 12 done... loading via adaptive collection, yadisk or local
This commit is contained in:
@@ -13,7 +13,7 @@ class TestLocalFilesystemAdaptiveCollection(unittest.TestCase):
|
||||
collection = LocalFilesystemAdaptiveCollection(str(self.samples_dir))
|
||||
|
||||
files = list(collection.iterate(recursive=False))
|
||||
file_names = sorted(Path(file.local_path).name for file in files)
|
||||
file_names = sorted(file.filename for file in files)
|
||||
|
||||
self.assertEqual(file_names, ["root.txt"])
|
||||
self.assertTrue(all(isinstance(file, LocalFilesystemAdaptiveFile) for file in files))
|
||||
@@ -33,7 +33,9 @@ class TestLocalFilesystemAdaptiveCollection(unittest.TestCase):
|
||||
|
||||
def test_work_with_file_locally_provides_existing_path(self):
|
||||
target_path = self.samples_dir / "root.txt"
|
||||
adaptive_file = LocalFilesystemAdaptiveFile(target_path.suffix, str(target_path))
|
||||
adaptive_file = LocalFilesystemAdaptiveFile(
|
||||
target_path.name, target_path.suffix, str(target_path)
|
||||
)
|
||||
|
||||
observed = {}
|
||||
|
||||
@@ -44,6 +46,7 @@ class TestLocalFilesystemAdaptiveCollection(unittest.TestCase):
|
||||
|
||||
adaptive_file.work_with_file_locally(callback)
|
||||
|
||||
self.assertEqual(adaptive_file.filename, "root.txt")
|
||||
self.assertEqual(observed["path"], str(target_path))
|
||||
self.assertEqual(observed["content"], "root file")
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ class TestYandexDiskAdaptiveCollection(unittest.TestCase):
|
||||
self.skipTest(f"Yandex Disk request failed and needs manual verification: {exc}")
|
||||
|
||||
for item in files:
|
||||
self.assertTrue(item.filename)
|
||||
logger.info(f"Yandex file found during test iteration: {item.local_path}")
|
||||
|
||||
self.assertIsInstance(files, list)
|
||||
|
||||
Reference in New Issue
Block a user