[sync] tests introduced
This commit is contained in:
1 parent
b5fdb0d6d6
commit
40a5d09e78
2 files changed
+43
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import unittest
|
||||
|
||||
from sync.models import Model
|
||||
|
||||
|
||||
class MyTestCase(unittest.TestCase):
|
||||
def test_bake(self):
|
||||
m = Model()
|
||||
self.assertIsNone(m.bake())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,30 @@
|
||||
import unittest
|
||||
|
||||
import settings
|
||||
from sync.data import scan_subdirs
|
||||
from sync.data.fs import FSProvider
|
||||
from sync.document import create_document
|
||||
from sync.models.document import Document
|
||||
from utils.fn import lmap
|
||||
|
||||
|
||||
class MyTestCase(unittest.TestCase):
|
||||
def test_document(self):
|
||||
p = FSProvider(settings.dir_documents)
|
||||
|
||||
documents = scan_subdirs(p, '.pdf')
|
||||
# documents = lmap(
|
||||
# lambda document: create_document(p, document),
|
||||
# documents
|
||||
# )
|
||||
|
||||
self.assertEqual(True, True)
|
||||
|
||||
def test_scan(self):
|
||||
p = FSProvider(settings.dir_documents)
|
||||
documents = scan_subdirs(p, '.pdf')
|
||||
self.assertIsInstance(documents, list)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user