Add base classes for mutators.

Review Request #12270 — Created May 6, 2022 and submitted

Information

Django Evolution
release-2.x

Reviewers

This introduces two new class: BaseMutator and BaseAppStateMutator.

BaseMutator is the base class for all mutators. It stores a couple of
attributes used in the mutator process (can_simulate and finalized),
introduces a function for finalizing, and a default to_sql()
implementation.

BaseAppStateMutator subclasses this, takes the parent AppMutator,
and sets up some forwarding properties that reflect or update the
AppMutator. It contains run_mutation() and run_simulation()
functions as well.

Right now, only ModelMutator subclasses BaseAppStateMutator, but
another will be coming soon.

All unit tests pass.

Tested along with an upcoming new mutator.

Summary ID
Add base classes for mutators.
This introduces two new class: `BaseMutator` and `BaseAppStateMutator`. `BaseMutator` is the base class for all mutators. It stores a couple of attributes used in the mutator process (`can_simulate` and `finalized`), introduces a function for finalizing, and a default `to_sql()` implementation. `BaseAppStateMutator` subclasses this, takes the parent `AppMutator`, and sets up some forwarding properties that reflect or update the `AppMutator`. It contains `run_mutation()` and `run_simulation()` functions as well. Right now, only `ModelMutator` subclasses `BaseAppStateMutator`, but another will be coming soon.
ac3fdb630cab20751bf35a76a5b77eed8b7b1b0a
Description From Last Updated

F821 undefined name 'CannotSimulate'

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.x (d815c93)