mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Begining to build in directory recursion for book scanning
This commit is contained in:
0
tests/__init__.py
Executable file
0
tests/__init__.py
Executable file
BIN
tests/__pycache__/test_library.cpython-37.pyc
Normal file
BIN
tests/__pycache__/test_library.cpython-37.pyc
Normal file
Binary file not shown.
BIN
tests/__pycache__/test_sysio.cpython-37.pyc
Executable file
BIN
tests/__pycache__/test_sysio.cpython-37.pyc
Executable file
Binary file not shown.
18
tests/test_library.py
Executable file
18
tests/test_library.py
Executable file
@@ -0,0 +1,18 @@
|
||||
import unittest
|
||||
from library import Catalogue
|
||||
|
||||
|
||||
class Testing(unittest.TestCase):
|
||||
|
||||
def test_libray_catalogue(self):
|
||||
self.assertIsNotNone(Catalogue())
|
||||
|
||||
def test_library_catalogue_scan_folder(self):
|
||||
self.assertIsInstance(Catalogue().scan_folder(), object)
|
||||
|
||||
def test_library_catalogue_compare_shelf_current(self):
|
||||
self.assertIsInstance(Catalogue().compare_shelf_current(), Catalogue)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
22
tests/test_sysio.py
Executable file
22
tests/test_sysio.py
Executable file
@@ -0,0 +1,22 @@
|
||||
import unittest
|
||||
import os
|
||||
import shutil
|
||||
from pyShelf import InitFiles
|
||||
from pyShelf import Epub
|
||||
|
||||
|
||||
class SysIoTest(unittest.TestCase):
|
||||
|
||||
def test_sysio_InitFiles(self):
|
||||
file_array = ["temp/test_file_1", "temp/test_file_2"]
|
||||
InitFiles(file_array)
|
||||
self.assertTrue(os.path.isfile(file_array[0]))
|
||||
|
||||
def tearDown(self):
|
||||
try:
|
||||
shutil.rmtree("temp")
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user