-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split integration tests to separate files and add test for salam pax'…
…s blog
- Loading branch information
1 parent
541f6cc
commit b2f7543
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import tempfile | ||
|
||
import pytest | ||
|
||
from blog2epub.blog2epub_main import Blog2Epub | ||
from blog2epub.common.book import Book | ||
from blog2epub.common.interfaces import EmptyInterface | ||
from blog2epub.models.configuration import ConfigurationModel | ||
|
||
|
||
@pytest.fixture() | ||
def mock_configuration() -> ConfigurationModel: | ||
return ConfigurationModel( | ||
destination_folder=tempfile.gettempdir(), | ||
limit="2", | ||
) | ||
|
||
|
||
class TestBlog2EPubMainSalamPax: | ||
def test_velosov_can_parse_the_date(self, mock_configuration): | ||
# given | ||
given_blog2epub = Blog2Epub( | ||
url="dear_raed.blogspot.com", | ||
interface=EmptyInterface(), | ||
configuration=mock_configuration, | ||
cache_folder="tests_cache", | ||
) | ||
# when | ||
given_blog2epub.download() | ||
ebook = Book( | ||
book_data=given_blog2epub.crawler.get_book_data(), | ||
interface=EmptyInterface(), | ||
configuration=mock_configuration, | ||
) | ||
ebook.save() | ||
# then | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import tempfile | ||
|
||
import pytest | ||
|
||
from blog2epub.blog2epub_main import Blog2Epub | ||
from blog2epub.common.book import Book | ||
from blog2epub.common.interfaces import EmptyInterface | ||
from blog2epub.models.configuration import ConfigurationModel | ||
|
||
|
||
@pytest.fixture() | ||
def mock_configuration() -> ConfigurationModel: | ||
return ConfigurationModel( | ||
destination_folder=tempfile.gettempdir(), | ||
limit="2", | ||
) | ||
|
||
|
||
class TestBlog2EPubMainVelosov: | ||
def test_velosov_can_parse_the_date(self, mock_configuration): | ||
# given | ||
given_blog2epub = Blog2Epub( | ||
url="velosov.blogspot.com", | ||
interface=EmptyInterface(), | ||
configuration=mock_configuration, | ||
cache_folder="tests_cache", | ||
) | ||
# when | ||
given_blog2epub.download() | ||
ebook = Book( | ||
book_data=given_blog2epub.crawler.get_book_data(), | ||
interface=EmptyInterface(), | ||
configuration=mock_configuration, | ||
) | ||
ebook.save() | ||
# then | ||
pass |