diff --git a/md_pdf/config/read.py b/md_pdf/config/read.py index 046064b..20ad7d2 100644 --- a/md_pdf/config/read.py +++ b/md_pdf/config/read.py @@ -6,7 +6,7 @@ from md_pdf.exceptions import ConfigValidationException def load_config(location=CONFIG_FILE): try: - with open(os.path.join(location)) as f: + with open(location) as f: return yaml.safe_load(f) except FileNotFoundError: raise ConfigValidationException("Can't find config file at {}".format(CONFIG_FILE)) diff --git a/tests/test_pandoc.py b/tests/test_pandoc.py index 4725bbc..df933a7 100644 --- a/tests/test_pandoc.py +++ b/tests/test_pandoc.py @@ -1,7 +1,23 @@ from tests import BaseTestCase from md_pdf.build.pandoc import output_html, build_document +from md_pdf.build.md import read_files from md_pdf.utils import remove_dir import os +import glob + + +class ReadFileTestCase(BaseTestCase): + file_glob = 'test-files/*.md' + + def test_reads_files(self): + files = read_files(self.file_glob) + self.assertNotEqual(files, '') + + def test_contains_all_files(self): + files = read_files(self.file_glob) + for file in glob.iglob(self.file_glob): + with open(file) as f: + self.assertIn(f.read(), files) class OutputHTMLTestCase(BaseTestCase):