You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
breadability/tests/utils.py

19 lines
482 B
Python

from os import path
TEST_DIR = path.dirname(__file__)
def load_snippet(filename):
"""Helper to fetch in the content of a test snippet"""
file_path = path.join(TEST_DIR, 'test_snippets', filename)
with open(file_path) as file:
return file.read()
def load_article(filename):
"""Helper to fetch in the content of a test article"""
file_path = path.join(TEST_DIR, 'test_articles', filename)
with open(file_path) as file:
return file.read()