test_release.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:maintain 作者: kylef 项目源码 文件源码
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())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号