def testOutputFiles(self):
     input_file = "../../common/transient.i"
     input_tree = self.create_tree(input_file)
     output_names = OutputNames.getOutputFiles(input_tree, input_file)
     self.assertEqual(output_names, ["out_transient.e"])
     outputs = input_tree.getBlockInfo("/Outputs")
     file_base = outputs.getParamInfo("file_base")
     file_base.value = "new_file_base"
     outputs.parameters_list.remove("file_base")
     del outputs.parameters["file_base"]
     output_names = OutputNames.getOutputFiles(input_tree, input_file)
     self.assertEqual(output_names, ["transient_out.e"])
Beispiel #2
0
 def testOutputFiles(self):
     input_file = "../../common/transient.i"
     input_tree = self.create_tree(input_file)
     output_names = OutputNames.getOutputFiles(input_tree, input_file)
     self.assertEqual(output_names, ["out_transient.e"])
     outputs = input_tree.getBlockInfo("/Outputs")
     file_base = outputs.getParamInfo("file_base")
     file_base.value = "new_file_base"
     outputs.parameters_list.remove("file_base")
     del outputs.parameters["file_base"]
     output_names = OutputNames.getOutputFiles(input_tree, input_file)
     self.assertEqual(output_names, ["transient_out.e"])
 def testDate(self):
     input_file = "../../common/transient_with_date.i"
     input_tree = self.create_tree(input_file)
     output_names = OutputNames.getOutputFiles(input_tree, input_file)
     utc = datetime.datetime.utcnow()
     self.assertEqual(
         output_names,
         ["with_date.e",
          "with_date_%s.e" % utc.strftime("%Y-%m-%d")])
Beispiel #4
0
    def testOversample(self):
        input_file = "../../common/oversample.i"
        input_tree = self.create_tree(input_file)
        output_names = OutputNames.getOutputFiles(input_tree, input_file)
        self.assertEqual(output_names, ["out_transient.e", "oversample_2_oversample.e"])

        outputs = input_tree.getBlockInfo("/Outputs")
        outputs.parameters_list.remove("file_base")
        del outputs.parameters["file_base"]

        output_names = OutputNames.getOutputFiles(input_tree, input_file)
        self.assertEqual(output_names, ["oversample_out.e", "oversample_2_oversample.e"])

        outputs = input_tree.getBlockInfo("/Outputs/refine_2")
        t = outputs.getTypeBlock()
        t.parameters_list.remove("file_base")
        del t.parameters["file_base"]

        output_names = OutputNames.getOutputFiles(input_tree, input_file)
        self.assertEqual(output_names, ["oversample_out.e", "oversample_refine_2_oversample.e"])
    def testOversample(self):
        input_file = "../../common/oversample.i"
        input_tree = self.create_tree(input_file)
        output_names = OutputNames.getOutputFiles(input_tree, input_file)
        self.assertEqual(output_names, ["out_transient.e", "oversample_2.e"])

        outputs = input_tree.getBlockInfo("/Outputs")
        outputs.parameters_list.remove("file_base")
        del outputs.parameters["file_base"]

        output_names = OutputNames.getOutputFiles(input_tree, input_file)
        self.assertEqual(output_names, ["oversample_out.e", "oversample_2.e"])

        outputs = input_tree.getBlockInfo("/Outputs/refine_2")
        t = outputs.getTypeBlock()
        t.parameters_list.remove("file_base")
        del t.parameters["file_base"]

        output_names = OutputNames.getOutputFiles(input_tree, input_file)
        self.assertEqual(output_names,
                         ["oversample_out.e", "oversample_refine_2.e"])
Beispiel #6
0
 def testDate(self):
     input_file = "../../common/transient_with_date.i"
     input_tree = self.create_tree(input_file)
     output_names = OutputNames.getOutputFiles(input_tree, input_file)
     utc = datetime.datetime.utcnow()
     self.assertEqual(output_names, ["with_date.e", "with_date_%s.e" % utc.strftime("%Y-%m-%d")])