mass_driver.tests.fixtures
Reusable fixtures for mass-driver testing
Module Contents
Functions
| Create a git repo with inital commit at path | |
| Copy the repo_data folder to tmp_path | |
| Run ‘mass-driver run’ with a local repo and activity config | |
| Run mass-driver with given activityconfig over a sample LOCAL repo | |
| Run mass-driver migration.toml over input.yaml and check the output.yaml matches | |
| Scan mass-driver over workdir and check the scan_results.json matches | 
API
- mass_driver.tests.fixtures.repoize(path: pathlib.Path)[source]
- Create a git repo with inital commit at path 
- mass_driver.tests.fixtures.copy_folder(repo_data, tmp_path)[source]
- Copy the repo_data folder to tmp_path 
- mass_driver.tests.fixtures.massdrive_runlocal(repo_url: str | None, activity_configfilepath: pathlib.Path) mass_driver.models.activity.ActivityOutcome[source]
- Run ‘mass-driver run’ with a local repo and activity config - Returns: ActivityOutcome of the execution 
- mass_driver.tests.fixtures.massdrive(repo_url: str, activity_configfilepath: pathlib.Path, repo_is_path: bool = True)[source]
- Run mass-driver with given activityconfig over a sample LOCAL repo - The “repo” is either a local folder path which we’ll ‘git init && git commit -Am’ over, or a cloneable URL in which case we will pass it through. - We will rely on repo_is_path variable to determine if we need to masquerade the local path as a git repo or not. This means if giving a proper git cloneable URL, set - repo_is_path=False.- Note: See pytest-datadir’s “datadir” fixture for convenient data linking - Returns: A tuple of (PatchResult, ForgeResult, ScanResult) returned by mass-driver for that repo. If any of these activities are empty, None is given for it.