Add base classes for mutators.

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

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.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
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 Christian Hammond
django_evolution/mutators/app_mutator.py
django_evolution/mutators/base.py
django_evolution/mutators/model_mutator.py
django_evolution/mutators/sql_mutator.py
django_evolution/tests/test_model_mutator.py
Loading...