-
Notifications
You must be signed in to change notification settings - Fork 7
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
b2f7543
commit 9054120
Showing
7 changed files
with
46 additions
and
10 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
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,26 @@ | ||
from typing import Optional | ||
|
||
from lxml.html.soupparser import fromstring | ||
|
||
from blog2epub.crawlers.article_factory.default import DefaultArticleFactory | ||
from blog2epub.models.book import ArticleModel | ||
|
||
|
||
class BlogspotArticleFactory(DefaultArticleFactory): | ||
def get_title(self) -> Optional[str]: | ||
title = super().get_title() | ||
if self.blog_title is not None and title == self.blog_title: | ||
title = "Pomidor" | ||
return title | ||
|
||
def process(self) -> ArticleModel: | ||
self.tree = fromstring(self.html) | ||
return ArticleModel( | ||
url=self.url, | ||
title=self.get_title(), | ||
date=self.get_date(), | ||
images=self.get_images(), | ||
tags=self.get_tags(), | ||
content=self.get_content(), | ||
comments=self.get_comments(), | ||
) |
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
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
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
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
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