Skip to content

Add test for pretext generate datafile#1126

Open
Copilot wants to merge 5 commits intomainfrom
copilot/add-test-for-pretext-generate-datafile
Open

Add test for pretext generate datafile#1126
Copilot wants to merge 5 commits intomainfrom
copilot/add-test-for-pretext-generate-datafile

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

  • Create example project directory tests/examples/projects/datafile/ with:
    • source/main.ptx containing a <datafile> element with a text file reference
    • assets/data.csv as the external data file
    • publication/publication.ptx pointing to the assets directory
    • project.ptx manifest
  • Add test_generate_datafile function to tests/test_cli.py that:
    • Copies the example project to a temp directory
    • Runs pretext generate datafile
    • Verifies the generated XML file exists in generated-assets/datafile/
  • Rebase onto latest main
  • Fix formatting with black
Original prompt

This section details on the original issue you should resolve

<issue_title>Add test for pretext generate datafile</issue_title>
<issue_description>Tested the code locally, but I really need to add to our tests</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: oscarlevin <6504596+oscarlevin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/PreTeXtBook/pretext-cli/sessions/2dcc278a-da1e-4d0d-9c35-f17aa1fa7f57
Copilot AI changed the title [WIP] Add test for pretext generate datafile Add test for pretext generate datafile Mar 20, 2026
Copilot AI requested a review from oscarlevin March 20, 2026 15:33
Copy link
Member

@oscarlevin oscarlevin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks right. @copilot please rebase and ensure formatting is correct

Copilot AI and others added 3 commits March 21, 2026 19:44
* Initial plan

* Fix: print targets get better links in pelican generated site

When output_filename is not set for single-file output formats (PDF, EPUB,
KINDLE, BRAILLE), deploy_path() now scans the output directory for the
actual output file and returns a path including the filename. This allows
the pelican-generated landing page to link directly to the PDF (or other
single-file output) rather than the directory containing it.

Co-authored-by: oscarlevin <6504596+oscarlevin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/PreTeXtBook/pretext-cli/sessions/870d27e1-a45a-439c-943b-f8852da66683

* format

* add copilot instructions

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: oscarlevin <6504596+oscarlevin@users.noreply.github.com>
Co-authored-by: Oscar Levin <oscar.levin@unco.edu>
Copy link
Contributor Author

Copilot AI commented Mar 21, 2026

I think this looks right. @copilot please rebase and ensure formatting is correct

Done — rebased onto main and applied black formatting (acb33be). The only formatting change was collapsing a multi-line assert into a single line.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • runestone.academy
    • Triggering command: /usr/bin/python3 python3 scripts/fetch_core.py (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from oscarlevin March 21, 2026 19:44
@oscarlevin oscarlevin marked this pull request as ready for review March 21, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add test for pretext generate datafile

2 participants