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.2.0.tar.gz (11.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.2.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: repo_smith-0.2.0.tar.gz
  • Upload date:
  • Size: 11.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.2.0.tar.gz
Algorithm Hash digest
SHA256 42b2221ae0f604a08a7522ad72e6ea84048fd55b3c003493005cd8e4de87ed69
MD5 74d8241eb15f1d27d125b292db22635f
BLAKE2b-256 f130dc0801543d2763fe22c94a917ccf12569e07804da9f763fdc45031bc213a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: repo_smith-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cea1d236488d8f507c5955907363443baff50c0903179be6d12059809777c8af
MD5 39247b29aee2baee4a543853eaec2558
BLAKE2b-256 e35c6ae1f3f723282e40dd00bd3ac2ba7ed42e6934ea343381aec8acfdf47cb2

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