Skip to content

Latest commit

 

History

History
65 lines (44 loc) · 1.35 KB

README.md

File metadata and controls

65 lines (44 loc) · 1.35 KB

Static Site Helpers

Utilities for helping maintain static sites.

Usage

# Migrates dates from the file name to the post's frontmatter
./migrate_post_date.py <post_files>

Development

This project uses python3.

This project uses pipenv to isolate its environment. Install it with:

python3 -m pip install --user pipenv

Then install the project's dependencies:

pipenv install

This project uses unittest for testing. To run the tests:

pipenv run python -m unittest

Use pipenv run to run commands inside the virtualenv from outside the virtualenv. Use pipenv shell to get a shell inside the virtualenv.

Writing tests

The tests use Python's built-in unittest module. Add new files prefixed with test_ to the tests directory. Mirror the structure of the code.

Running Tests

From the root of the repository, run:

# Outside the virtualenv
pipenv run python -m unittest
# Inside the virtualenv
python -m unittest

To run a specific module, specify it after the command:

# Outside the virtualenv
pipenv run python -m unittest tests/lib/test_post.py
# Inside the virtualenv
python -m unittest tests/lib/test_post.py

Refer to the unittest docs or use the --help option to get further help.