mirror of
https://github.com/simon987/Simple-Incremental-Search-Tool.git
synced 2025-12-14 07:39:05 +00:00
Added web interface, crawler and more work on local storage
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from parsing import GenericFileParser, Sha1CheckSumCalculator, ExtensionMimeGuesser
|
||||
from crawler import Crawler
|
||||
|
||||
|
||||
class CrawlerTest(TestCase):
|
||||
|
||||
def test_dir_walk(self):
|
||||
c = Crawler()
|
||||
c = Crawler([GenericFileParser([Sha1CheckSumCalculator()], ExtensionMimeGuesser())])
|
||||
|
||||
c.crawl("test_folder")
|
||||
|
||||
self.assertEqual(len(c.documents), 28)
|
||||
|
||||
def test_get_parser_by_ext(self):
|
||||
|
||||
c = Crawler([GenericFileParser([Sha1CheckSumCalculator()], ExtensionMimeGuesser())])
|
||||
|
||||
self.assertIsInstance(c.get_parser_by_ext("any"), GenericFileParser)
|
||||
|
||||
# todo add more parsers here
|
||||
|
||||
Reference in New Issue
Block a user