def testWriteBuildfile(self): print "TestAntCopyProject : writeBuildfile" project = AntCopyProject("sample_properties/testAntCopyProject.xml", "file") project.setName("written-project") self.assertEqual(len(self.deployables), 2) processed = 0 project.deleteDir("tmp/package-home") for deployable in self.deployables: processed += 1 project.copyDir("d:/repo/" + deployable["repo-path"], "/**/*.*", "temp/deployment-root/" + deployable["name"] + "_" + deployable["version"]) self.assertEqual(processed, 2) project.property(name="package.home", value="tmp/package-home") project.updateConfigProps("config.properties", "package.home", "tmp/package-home") project.createSetEnvFile("PACKAGE_HOME", "/tmp/package-home") project.writeBuildfile()
def testDisplayProject(self): """ kinda difficult to do strict unit testing here - just displat the results for now """ print "TestAntCopyProject : displayProject" project = AntCopyProject("sample_properties/testCopyProject.xml", "file") project.setName("display-project") self.assertEqual(len(self.deployables), 2) processed = 0 for deployable in self.deployables: processed += 1 project.copyDir("d:/repo/" + deployable["repo-path"], "/**/*.*", "temp/deployment-root/" + deployable["name"] + "_" + deployable["version"]) self.assertEqual(processed, 2) project.copyDir(".", "psc_details.properties", "tmp/package.home") project.property(name="package.home", value="tmp/package-home") print "--- project xml ---" for line in project.project: print line