def test_git_release_without_remote(self):
with self.runner.isolated_filesystem():
with open('VERSION', 'w') as fp:
fp.write('1.0.0\n')
repo = Repo.init()
repo.index.add(['VERSION'])
repo.index.commit('Initial commit')
result = self.runner.invoke(release, ['2.0.0'])
self.assertIsNone(result.exception)
self.assertEqual(result.exit_code, 0)
with open('VERSION') as fp:
self.assertEqual(fp.read(), '2.0.0\n')
self.assertEqual(repo.refs.master.commit.message, 'Release 2.0.0')
self.assertEqual(repo.tags['2.0.0'].commit, repo.refs.master.commit)
self.assertFalse(repo.is_dirty())
评论列表
文章目录