Week 16 of 16

Test, Document, Reflect

Write tests. Write a README. Look back at how far you've come.

Day 80 90 minutes Build + Reflect

Day 80 of 80

The Last Three Things

Three tasks today. In order:

  1. Write tests. At least 5 that cover the core functionality. Run pytest and make them pass.
  2. Write a README. If someone found this project on GitHub, would they know what it does and how to use it?
  3. Reflect. Look back at where you started.

Part 1: Write Tests

Create tests/test_capstone.py. Aim for 5 tests minimum — more if you have time. Focus on the core behavior, not every edge case.

What to test

Ask yourself: What are the 5 things this tool absolutely must do correctly? Those are your tests. A few patterns to consider:

tests/test_capstone.py — template Python
import pytest
# Import whatever your project needs here

class TestCoreFunctionality:
    """Tests for the core things your capstone must do."""

    def test_main_thing_works(self):
        """The thing your tool is FOR — does it work?"""
        # Arrange: set up what you need
        # Act: call the thing
        # Assert: check the result
        pass

    def test_invalid_input_raises_clear_error(self):
        """Bad input should fail with a meaningful error, not a crash."""
        with pytest.raises(ValueError):  # or whatever exception you raise
            # call with bad input
            pass

    def test_data_round_trip(self, tmp_path):
        """Data should survive save and load."""
        # Write something, load it back, compare
        pass

    def test_empty_case(self):
        """No data should return empty result, not raise an error."""
        pass

    def test_output_shape(self):
        """The main output has the right structure."""
        pass

Run them: pytest tests/ -v

Part 2: Write a README

Create README.md in your project folder. Even if nobody else reads it, writing it forces you to think like a user instead of a builder.

README structure
# [Project Name]

One sentence: what does this do?

## What it does

2-3 bullet points. What problems does it solve?

## Setup

pip install -r requirements.txt

Set up your .env file:
ANTHROPIC_API_KEY=your-key-here

## Usage

[Your main commands with examples]

python dvp.py generate "Wide aerial over mountains" --save
python dvp.py batch shots.json --output results.json

## What I'd add next

If I had more time, I'd add:
- [thing 1]
- [thing 2]

Part 3: Reflect

The Before and After

Open your Week 1 exercise — shot_formatter.py or whichever was your first script. Read it.

That was Day 1. You wrote 7 lines of code and asked the user to type a shot description. The program printed it back formatted.

Now look at what you just built. You have:

16 weeks of Python

That's not "learning Python." That's knowing Python.

What's Next

Where to go from here

Final Checklist

You finished.

80 days. 16 weeks. One app that grew from 7 lines to a full-stack Python project with a database, API, CLI, tests, and async generation.

You're no longer someone who's "learning Python." You're someone who builds things with Python.

Now go build something real.