- Notifications
You must be signed in to change notification settings - Fork0
YAML-based configuration for Git repository initialization for unit testing
License
NotificationsYou must be signed in to change notification settings
git-mastery/repo-smith
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
YAML-based configuration for Git repository initialization for unit testing
pip install -U repo-smith
Create a new configuration file (following thespecification).
# File path: tests/specs/basic_spec.ymlname:Basic specdescription:Starting basic specinitialization:steps: -name:Create filea.txttype:new-filefilename:filea.txtcontents:| Hello world -name:Add filea.txttype:addfiles: -filea.txt -name:Initial committype:commitmessage:Initial commitid:initial-commit -name:v0 tagtype:tagtag-name:v0
Create a unit test accordingly.
fromrepo_smith.initialize_repoimportinitialize_repofromgitimportRepodeftest_dummy():repo_initializer=initialize_repo("test/specs/basic_spec.yml")withrepo_initializer.initialize()asrepo:# All unit testing code for the dummy repository goes hereprint(repo)
For more use cases ofrepo-smith
, refer to: