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.10.1.tar.gz (14.9 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.10.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: repo_smith-0.10.1.tar.gz
  • Upload date:
  • Size: 14.9 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.10.1.tar.gz
Algorithm Hash digest
SHA256 774ae7b71463ef87d9cd5b54d1b7c29b3e62968a17ba750eeb5bc028c63bb2a0
MD5 9983001527ee23af06a8e77283785806
BLAKE2b-256 19c01cf1235e1c5743ae4a9e58130c26c8810877c9cecfb6e3f40f0adaa7758f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: repo_smith-0.10.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 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.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3d684fc546603e1fc885790f35d84a7dd81168122752d3352f6fde8375c1a92
MD5 903f66ea0b6f29aa521ae02e9fbfcc3e
BLAKE2b-256 6261e3aa2d0f677d4e713a37ba7296f4e319a7e32e4134ca4f1dcd247e1fb504

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