Skip to main content

YAML-based configuration for initializing Git repositories for unit testing

Project description

repo-smith

YAML-based configuration for Git repository initialization for unit testing

Installation

pip install -U repo-smith

Usage

Create a new configuration file (following the specification).

# File path: tests/specs/basic_spec.yml
name: Basic spec
description: Starting basic spec
initialization:
  steps:
    - name: Create filea.txt
      type: new-file
      filename: filea.txt
      contents: |
        Hello world
    - name: Add filea.txt
      type: add
      files:
        - filea.txt
    - name: Initial commit
      type: commit
      message: Initial commit
      id: initial-commit
    - name: v0 tag
      type: tag
      tag-name: v0

Create a unit test accordingly.

from repo_smith.initialize_repo import initialize_repo
from git import Repo

def test_dummy():
  repo_initializer = initialize_repo("test/specs/basic_spec.yml")
  with repo_initializer.initialize() as repo:
    # All unit testing code for the dummy repository goes here
    print(repo)

For more use cases of repo-smith, refer to:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repo_smith-0.6.2.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repo_smith-0.6.2-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file repo_smith-0.6.2.tar.gz.

File metadata

  • Download URL: repo_smith-0.6.2.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for repo_smith-0.6.2.tar.gz
Algorithm Hash digest
SHA256 e8bec48ce7a574fb805c924b4ac11c47c6bc9e2fe5c80b9111e48896017d2e61
MD5 9baf87a9a93db527ed96f3d3d99466e5
BLAKE2b-256 d4a6fbc2926de6c18ab8b42a506a6a7dac8dccd6a20efeacb0fd4ceca2ec58e7

See more details on using hashes here.

File details

Details for the file repo_smith-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: repo_smith-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for repo_smith-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ada1bc5eebc1a3d54f83521fd694f775601391501f6a69340d2b8e1a40436831
MD5 694a2991154fc59fa7d4d018d5139af5
BLAKE2b-256 6bcbc209a41e8b299c34a5b814066400c6c9a6184bbcb87eb6bf8533f49c1266

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page