Skip to content

Commit

Permalink
Test: fixed/corrected the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
y0urself committed Aug 30, 2021
1 parent 3089a36 commit 4c40684
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/release/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def runner(cmd):
)
self.assertTrue(released)
self.assertIn(
"git commit -S 0815 --no-verify -m 'Automatic release to 0.0.1'",
"git commit -S0815 --no-verify -m 'Automatic release to 0.0.1'",
called,
)
self.assertIn(
Expand All @@ -130,11 +130,17 @@ def test_fail_if_tag_is_already_taken(self):
'prepare',
'--release-version',
'0.0.1',
'--project',
'bla',
]
runner = lambda x: StdOutput('v0.0.1'.encode())
with self.assertRaises(
ValueError, msg='git tag v0.0.1 is already taken'
):

called = []

def runner(cmd):
called.append(cmd)
return StdOutput('v0.0.1'.encode())

with self.assertRaises(SystemExit):
release.main(
shell_cmd_runner=runner,
_path=fake_path_class,
Expand All @@ -144,6 +150,8 @@ def test_fail_if_tag_is_already_taken(self):
args=args,
)

self.assertIn('git tag v0.0.1 is already taken', called)

def test_not_release_when_no_project_found(self):
fake_path_class = MagicMock(spec=Path)
fake_version = MagicMock(spec=version)
Expand Down

0 comments on commit 4c40684

Please sign in to comment.