コード例 #1
0
ファイル: views.py プロジェクト: slimjim777/capomastro
 def get_context_data(self, **kwargs):
     """
     Supplement the dependency.
     """
     context = super(
         DependencyUpdateView, self).get_context_data(**kwargs)
     params = [x for x in
               parse_parameters_from_job(self.object.job.jobtype.config_xml)
               if x["name"] != "BUILD_ID"]
     context["parameters"] = params
     return context
コード例 #2
0
ファイル: views.py プロジェクト: caiobegotti/capomastro
 def get_context_data(self, **kwargs):
     """
     Supplement the dependency.
     """
     context = super(
         DependencyUpdateView, self).get_context_data(**kwargs)
     params = [x for x in
               parse_parameters_from_job(self.object.job.jobtype.config_xml)
               if x["name"] != "BUILD_ID"]
     context["parameters"] = params
     return context
コード例 #3
0
ファイル: test_utils.py プロジェクト: notnownikki/capomastro
 def test_parse_parameters_from_job(self):
     """
     """
     self.assertEqual([
       {"name": "BUILD_ID",
        "description": "The projectbuild id to associate with.",
        "defaultValue": None},
       {"name": "BRANCH_TO_CHECKOUT",
        "description": "Branch to checkout and build.",
        "defaultValue": "http:///launchpad.net/mybranch"}],
       parse_parameters_from_job(job_with_parameters))
コード例 #4
0
ファイル: test_utils.py プロジェクト: bigkevmcd/capomastro
 def test_parse_parameters_from_job(self):
     """
     parse_parameters_from_job should extract the parameters from the job XML
     document and return the details.
     """
     jobtype = JobTypeWithParamsFactory.build()
     self.assertEqual([
       {"name": "BUILD_ID",
        "description": "The projectbuild id to associate with.",
        "defaultValue": None},
       {"name": "BRANCH_TO_CHECKOUT",
        "description": "Branch to checkout and build.",
        "defaultValue": "http:///launchpad.net/mybranch"}],
       parse_parameters_from_job(jobtype.config_xml))
コード例 #5
0
ファイル: test_utils.py プロジェクト: caiobegotti/capomastro
 def test_parse_parameters_from_job(self):
     """
     parse_parameters_from_job should extract the parameters from the job XML
     document and return the details.
     """
     jobtype = JobTypeWithParamsFactory.build()
     self.assertEqual([{
         "name": "BUILD_ID",
         "description": "The projectbuild id to associate with.",
         "defaultValue": None
     }, {
         "name": "BRANCH_TO_CHECKOUT",
         "description": "Branch to checkout and build.",
         "defaultValue": "http:///launchpad.net/mybranch"
     }], parse_parameters_from_job(jobtype.config_xml))
コード例 #6
0
ファイル: test_utils.py プロジェクト: bigkevmcd/capomastro
    def test_add_parameter_to_job(self):
        """
        add_parameter_to_job adds the XML for a JenkinsParameter to a Jenkins
        job document.
        """
        parameter = JenkinsParameter("TEST_ID", "Testing Element", "DEFAULT")
        jobtype = JobTypeWithParamsFactory.build()
        new_xml = add_parameter_to_job(parameter, jobtype.config_xml)

        self.assertEqual([
          {"name": "BUILD_ID",
           "description": "The projectbuild id to associate with.",
           "defaultValue": None},
          {"name": "BRANCH_TO_CHECKOUT",
           "description": "Branch to checkout and build.",
           "defaultValue": "http:///launchpad.net/mybranch"},
          {"name": "TEST_ID",
           "description": "Testing Element",
           "defaultValue": "DEFAULT"}],
          parse_parameters_from_job(new_xml))
コード例 #7
0
ファイル: test_utils.py プロジェクト: caiobegotti/capomastro
    def test_add_parameter_to_job(self):
        """
        add_parameter_to_job adds the XML for a JenkinsParameter to a Jenkins
        job document.
        """
        parameter = JenkinsParameter("TEST_ID", "Testing Element", "DEFAULT")
        jobtype = JobTypeWithParamsFactory.build()
        new_xml = add_parameter_to_job(parameter, jobtype.config_xml)

        self.assertEqual([{
            "name": "BUILD_ID",
            "description": "The projectbuild id to associate with.",
            "defaultValue": None
        }, {
            "name": "BRANCH_TO_CHECKOUT",
            "description": "Branch to checkout and build.",
            "defaultValue": "http:///launchpad.net/mybranch"
        }, {
            "name": "TEST_ID",
            "description": "Testing Element",
            "defaultValue": "DEFAULT"
        }], parse_parameters_from_job(new_xml))
コード例 #8
0
 def get_parameters(self):
     """
     Parse the config_xml and extract the parameters.
     """
     return parse_parameters_from_job(self.config_xml)
コード例 #9
0
ファイル: models.py プロジェクト: bigkevmcd/capomastro
 def get_parameters(self):
     """
     Parse the config_xml and extract the parameters.
     """
     return parse_parameters_from_job(self.config_xml)