From 4b2fa09e283d35afa7f602c9a59cc5999d0ecc98 Mon Sep 17 00:00:00 2001 From: Cody Scott Date: Thu, 11 Jan 2024 13:47:20 -0500 Subject: [PATCH] Test if htmd works in child directories --- tests/test_build.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_build.py b/tests/test_build.py index cd1dec6..1ffb244 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -422,3 +422,14 @@ def test_build_day_404_no_posts(): result = runner.invoke(build) assert result.exit_code == 1 assert result.output == expected_output + + +def test_build_from_sub_directory(): + runner = CliRunner() + with runner.isolated_filesystem(): + runner.invoke(start) + current_directory = os.getcwd() + os.chdir(os.path.join(current_directory, 'posts')) + result = runner.invoke(build) + assert result.exit_code == 0 + assert re.search(SUCCESS_REGEX, result.output)