test_jenkins_set_options.py 文件源码

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

项目:bob 作者: BobBuildTool 项目源码 文件源码
def testSetGitShallowClone(self):
        self.executeBobJenkinsCmd("set-options -o scm.git.shallow=42 myTestJenkins")
        self.executeBobJenkinsCmd("push -q myTestJenkins")
        send = self.jenkinsMock.getServerData()
        config = ElementTree.fromstring(send[0][1])
        for clone in config.iter('hudson.plugins.git.extensions.impl.CloneOption'):
            found = 0
            for a in clone.getiterator():
                if a.tag == 'shallow':
                    assert(a.text == 'true')
                    found += 1
                if a.tag == 'depth':
                    assert(a.text == '42')
                    found += 1
            assert(found == 2)
        self.executeBobJenkinsCmd("set-options -o scm.git.shallow=-1 myTestJenkins")
        with self.assertRaises(Exception) as c:
            self.executeBobJenkinsCmd("push -q myTestJenkins")
        assert(type(c.exception) == BuildError)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号