mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add tests for ResourceReader implementation
This commit is contained in:
parent
ccdfbe96d5
commit
0c2b5e5b32
@ -43,6 +43,16 @@ class BuildTest(unittest.TestCase):
|
||||
self.assertTrue(bus.list_names(), 'Failed to list names on the session bus')
|
||||
del bus
|
||||
|
||||
def test_loaders(self):
|
||||
import importlib
|
||||
ldr = importlib.import_module('calibre').__spec__.loader
|
||||
self.assertIn('ebooks', ldr.contents())
|
||||
try:
|
||||
raw = ldr.open_resource('__init__.py').read()
|
||||
except FileNotFoundError:
|
||||
raw = ldr.open_resource('__init__.pyc').read()
|
||||
self.assertGreater(len(raw), 1024)
|
||||
|
||||
def test_regex(self):
|
||||
import regex
|
||||
self.assertEqual(regex.findall(r'(?i)(a)(b)', 'ab cd AB 1a1b'), [('a', 'b'), ('A', 'B')])
|
||||
|
Loading…
x
Reference in New Issue
Block a user