File tree Expand file tree Collapse file tree 2 files changed +74
-0
lines changed
tests/integration/blog2epub Expand file tree Collapse file tree 2 files changed +74
-0
lines changed Original file line number Diff line number Diff line change 1+ import tempfile
2+
3+ import pytest
4+
5+ from blog2epub .blog2epub_main import Blog2Epub
6+ from blog2epub .common .book import Book
7+ from blog2epub .common .interfaces import EmptyInterface
8+ from blog2epub .models .configuration import ConfigurationModel
9+
10+
11+ @pytest .fixture ()
12+ def mock_configuration () -> ConfigurationModel :
13+ return ConfigurationModel (
14+ destination_folder = tempfile .gettempdir (),
15+ limit = "2" ,
16+ )
17+
18+
19+ class TestBlog2EPubMainSalamPax :
20+ def test_velosov_can_parse_the_date (self , mock_configuration ):
21+ # given
22+ given_blog2epub = Blog2Epub (
23+ url = "dear_raed.blogspot.com" ,
24+ interface = EmptyInterface (),
25+ configuration = mock_configuration ,
26+ cache_folder = "tests_cache" ,
27+ )
28+ # when
29+ given_blog2epub .download ()
30+ ebook = Book (
31+ book_data = given_blog2epub .crawler .get_book_data (),
32+ interface = EmptyInterface (),
33+ configuration = mock_configuration ,
34+ )
35+ ebook .save ()
36+ # then
37+ pass
Original file line number Diff line number Diff line change 1+ import tempfile
2+
3+ import pytest
4+
5+ from blog2epub .blog2epub_main import Blog2Epub
6+ from blog2epub .common .book import Book
7+ from blog2epub .common .interfaces import EmptyInterface
8+ from blog2epub .models .configuration import ConfigurationModel
9+
10+
11+ @pytest .fixture ()
12+ def mock_configuration () -> ConfigurationModel :
13+ return ConfigurationModel (
14+ destination_folder = tempfile .gettempdir (),
15+ limit = "2" ,
16+ )
17+
18+
19+ class TestBlog2EPubMainVelosov :
20+ def test_velosov_can_parse_the_date (self , mock_configuration ):
21+ # given
22+ given_blog2epub = Blog2Epub (
23+ url = "velosov.blogspot.com" ,
24+ interface = EmptyInterface (),
25+ configuration = mock_configuration ,
26+ cache_folder = "tests_cache" ,
27+ )
28+ # when
29+ given_blog2epub .download ()
30+ ebook = Book (
31+ book_data = given_blog2epub .crawler .get_book_data (),
32+ interface = EmptyInterface (),
33+ configuration = mock_configuration ,
34+ )
35+ ebook .save ()
36+ # then
37+ pass
You can’t perform that action at this time.
0 commit comments