autowisp.tests.test_database_migration module

Class Inheritance Diagram

Inheritance diagram of TestAdditiveMigrations

Unit tests for the lightweight additive-column migration.

These need only a throwaway SQLite database, not a full project, so they subclass unittest.TestCase directly.

class autowisp.tests.test_database_migration.TestAdditiveMigrations(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_database_migration.TestAdditiveMigrations

apply_additive_migrations adds missing nullable columns.

_make_old_project()[source]

Simulate an existing project: a pipeline_run table from before code_version and the error table existed, holding a row.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_adds_missing_code_version()[source]

An old pipeline_run (no code_version) gains the column.

test_adds_missing_resolved_to_old_error_table()[source]

An older error table (no resolved) gains the column.

test_creates_missing_error_table()[source]

An existing project gains the new error table.

test_idempotent()[source]

Re-running is a no-op and does not raise.

test_preexisting_rows_and_data_preserved()[source]

Existing rows survive; the new column is NULL for them.