4 from manga_py
import fs
5 from manga_py
.provider
import Provider
6 from manga_py
.providers
import get_provider
8 root_path
= path
.dirname(path
.realpath(__file__
))
11 class TestInitProvider(unittest
.TestCase
):
14 def test_get_provider1(self
):
15 provider
= get_provider('http://readmanga.live/manga/name/here')
16 self
.assertIsInstance(provider(), Provider
)
19 def test_get_provider2(self
):
20 provider
= get_provider('http://example.org/manga/name/here')
21 self
.assertFalse(provider
)
23 def test_root_path(self
):
24 self
.assertEqual(path
.realpath(fs
.path_join(root_path
, '..')), fs
.root_path())
26 def test_file_name_query_remove1(self
):
27 name
= '/addr/to/filename'
30 fs
.remove_file_query_params(name
+ '?query=params').replace('\\', '/') # windows os patch
33 def test_file_name_query_remove2(self
):
34 name
= '/addr/to/filename/'
37 fs
.remove_file_query_params(name
+ '?query=params').replace('\\', '/') # windows os patch