mirror of
https://github.com/bookieio/breadability
synced 2024-11-18 09:25:29 +00:00
Load articles/snippets as binary strings
This commit is contained in:
parent
e6191fe0d1
commit
05d2230015
@ -12,12 +12,12 @@ TEST_DIR = abspath(dirname(__file__))
|
||||
def load_snippet(file_name):
|
||||
"""Helper to fetch in the content of a test snippet."""
|
||||
file_path = join(TEST_DIR, "data/snippets", file_name)
|
||||
with open(file_path) as file:
|
||||
with open(file_path, "rb") as file:
|
||||
return file.read()
|
||||
|
||||
|
||||
def load_article(file_name):
|
||||
"""Helper to fetch in the content of a test article."""
|
||||
file_path = join(TEST_DIR, "data/articles", file_name)
|
||||
with open(file_path) as file:
|
||||
with open(file_path, "rb") as file:
|
||||
return file.read()
|
||||
|
Loading…
Reference in New Issue
Block a user