ehmatthes / ehmatthes/intro_programming
Clean up test_links.py
- Dominant language
- Jupyter Notebook
- Stars
- 400
- Forks
- 191
- PR merge metrics
- No merged PRs in 30d
Description
I don't think there will be a whole lot of tests for this project, because it's mostly a writing project. I don't envision all of the code in the notebooks being tested; a good error reporting system should take care of those issues.
#### [test_links.py](https://github.com/ehmatthes/intro_programming/blob/master/tests/test_links.py)
One test I do care about is the ability to test all links in the project. Links are particularly important for this project, because every time someone follows a link, they are trying to understand something. Broken links make it difficult to build understanding, which would quickly lead to frustration. People also use links to navigate to the topics they are currently working on, and to go back to topics they are starting to understand but need some review on.
This test should:
- verify that all links _between_ notebooks are working;
- verify that all _external links_ are working;
- verify that all _anchor links_ are working.
The test currently **finds** all links in a local cache of html files. It then **tests** those links against either a locally served version of the project, or an externally deployed version. The --root (-r) flag lets you set the url root that the files are served at, which is by default `http://localhost:8000`, the address of the SimpleHTTPServer that is run by the script itself. The test **should** either find links from local html files, and then test those locally, or find links from deployed files, and then test those deployed files.
For now, I can use the script as is to test locally (that will continue to work), or I can deploy and then test the deployed files. It's a bit scrappy for the moment, but it works for now and refinement of this script is fairly low-hanging fruit.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.