forked from noirbizarre/bumpr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b7fe74c
commit 0221c33
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from bumpx.forge import BaseForge, GitHub | ||
|
||
|
||
class BaseForgeTest: | ||
def test_execute_verbose(self, mocker): | ||
forge = BaseForge(verbose=True) | ||
execute = mocker.patch("bumpx.forge.execute") | ||
forge.execute("cmd arg") | ||
execute.assert_called_with("cmd arg", verbose=True) | ||
|
||
def test_execute_quiet(self, mocker): | ||
forge = BaseForge(verbose=False) | ||
execute = mocker.patch("bumpx.forge.execute") | ||
forge.execute("cmd arg") | ||
execute.assert_called_with("cmd arg", verbose=False) | ||
|
||
|
||
class GitHubTest: | ||
def test_release(self, mocker): | ||
github = GitHub() | ||
|
||
execute = mocker.patch.object(github, "execute") | ||
github.release(version="fake") | ||
execute.assert_called_with(["gh", "release", "create", "fake", "--title", "fake"]) | ||
|
||
def test_release_with_notes(self, mocker): | ||
github = GitHub() | ||
|
||
execute = mocker.patch.object(github, "execute") | ||
github.release(version="fake", notes="some notes") | ||
execute.assert_called_with( | ||
["gh", "release", "create", "fake", "--title", "fake", "--notes", "some notes"] | ||
) |