Skip to content

Commit

Permalink
fix: add test for doc generate from another dir
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-orange committed Jan 28, 2025
1 parent 3d5f7f2 commit a9a1b19
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions tests/functional/adapter/basic/test_docs_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,30 @@ def test_run_and_generate(self, project, expected_catalog):
verify_catalog(project, expected_catalog, start_time)

# Check that assets have been copied to the target directory for use in the docs html page
assert os.path.exists(os.path.join("", "target", "assets"))
assert os.path.exists(os.path.join("", "target", "assets", "lorem-ipsum.txt"))
assert not os.path.exists(os.path.join("", "target", "non-existent-assets"))
assert os.path.exists(os.path.join(project.project_root, "target", "assets"))
assert os.path.exists(
os.path.join(project.project_root, "target", "assets", "lorem-ipsum.txt")
)
assert not os.path.exists(
os.path.join(project.project_root, "target", "non-existent-assets")
)

# Test generic "docs generate" command
def test_locally_run_and_generate(self, project, expected_catalog):
os.chdir(
project.profiles_dir
) # Change to random directory to test that assets doc generation works with project-dir
start_time = run_and_generate(project)
verify_catalog(project, expected_catalog, start_time)

# Check that assets have been copied to the target directory for use in the docs html page
assert os.path.exists(os.path.join(project.project_root, "target", "assets"))
assert os.path.exists(
os.path.join(project.project_root, "target", "assets", "lorem-ipsum.txt")
)
assert not os.path.exists(
os.path.join(project.project_root, "target", "non-existent-assets")
)


class TestDocsGenerate(BaseDocsGenerate):
Expand Down

0 comments on commit a9a1b19

Please sign in to comment.