Пример #1
0
 def test_change_custom_workspace(self):
     sample_xml = """
     <project>
       <actions/>
       <description/>
       <keepDependencies>false</keepDependencies>
       <properties/>
       <scm class="hudson.scm.NullSCM"/>
       <canRoam>true</canRoam>
       <disabled>false</disabled>
       <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
       <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
       <triggers class="vector"/>
       <concurrentBuild>false</concurrentBuild>
       <customWorkspace>my/test/workspace</customWorkspace>
       <builders/>
       <publishers/>
       <buildWrappers/>
     </project>"""
     
     new_custom_workspace = "some/new/path"
     j = JobXML(sample_xml)
     j.custom_workspace = new_custom_workspace
     actual_xml = j.XML
     
     self.assertTrue("<customWorkspace>" + new_custom_workspace + "</customWorkspace>" in actual_xml)
Пример #2
0
 def test_new_custom_workspace(self):    
     custom_workspace_path = "something/else"
     
     j = JobXML(self.__test_config)
     j.custom_workspace = custom_workspace_path
     actual_xml = j.XML
     
     self.assertTrue("<customWorkspace>" + custom_workspace_path + "</customWorkspace>" in actual_xml)
Пример #3
0
    def custom_workspace(self, path):
        """Defines a new custom workspace for the job

        :param str path: new custom workspace path
        """
        xml = self.config_xml

        jobxml = JobXML(xml)
        jobxml.custom_workspace = path

        self.config_xml = jobxml.xml