コード例 #1
0
    def test_create_extra(self):
        p = self.project
        
        # extra information
        giturl = "git://some.git.repos/me/project.git"
        g = GitRepository(
            project = p,
            name = "Another Git Repos",
            url = giturl,
            poll_interval = 123,
            branch = 'special-branch',
        )
        g.save()
        self.assertEqual(_("Git"), g.get_config_type())
        
        # check args
        args = g.get_config_args()
        self.assertEqual(args.get("repourl", None), giturl)
        self.assertEqual(args.get("pollinterval", None), 123 * 60)
        self.assertEqual(args.get("branch", None), "special-branch")
        
        # check that the config object can be instantiated
        self.assert_valid_buildbot_config(g.get_config_class(), args)
        
        # even if buildbot has gitpoller, we also test with the one included 
        # in contrib (to improve coverage)
        settings.BUILDBOT_HAS_GITPOLLER = False
        self.assert_valid_buildbot_config(g.get_config_class(), args)
            
        # Check that the resulting config string is sensible
        self.assert_config_string_executable(g)
        

        
コード例 #2
0
 def test_create_init(self):
     p = self.project
     
     # minimal information
     giturl = "git://some.git.repos/me/project.git"
     g = GitRepository(
         project = p,
         name = "My Git Repos",
         url = giturl,
     )
     g.save()
     self.assertEqual(_("Git"), g.get_config_type())
     
     # check default arguments
     args = g.get_config_args()
     self.assertEqual(args.get("repourl", None), giturl)
     self.assertEqual(args.get("pollinterval", None), settings.DEFAULT_POLL_INTERVAL * 60)
     self.assertEqual(args.get("branch", None), "master")
     
     # check that the config object can be instantiated
     self.assert_valid_buildbot_config(g.get_config_class(), args)
     
     # Check that the resulting config string is sensible
     self.assert_config_string_executable(g)