Esempio n. 1
0
 def test_reference_diff(self):
     dir_path = os.path.dirname(os.path.realpath(__file__))
     (diff_statuses,
      return_message_str) = nrtDiff.DirectoryDiffReferenceDataJob(
          os.path.join(dir_path, "test.jobs"))
     self.assertEqual(diff_statuses, nrtDiff.DIFFERENT)
     self.assertEqual(len(return_message_str), 1)
     if "output/Job2/curves.csv: 5 absolute errors" not in return_message_str[
             0]:
         self.assertTrue(False)
Esempio n. 2
0
                print(
                    "Failed to remove notification file. Unable to conduct nrt"
                )
                sys.exit(1)
        start_time = time.time()
        NRT.launchCases()
        end_time = time.time()
        NRT.setRealTime(end_time - start_time)

        for case in NRT.test_cases_:
            if (not case.ok_):
                case.diff_ = nrtDiff.UNABLE_TO_CHECK
            else:
                case_dir = os.path.dirname(case.jobs_file_)
                (status,
                 messages) = nrtDiff.DirectoryDiffReferenceDataJob(case_dir)
                case.diff_ = status
                case.diff_messages_ = messages

        # Export results as html
        NRT.exportHTML(html_output)
        if (NRT.number_of_nok_cases_ > 0):
            logFile = open(NRT_RESULT_FILE, "w")
            logFile.write("NRT NOK\n")
            logFile.write(
                "Run on " +
                datetime.datetime.now().strftime("%Y-%m-%d at %Hh%M") + "\n")
            logFile.write(" Nb nok case : " + str(NRT.number_of_nok_cases_) +
                          "\n")
            logFile.close()
        sys.exit(NRT.number_of_nok_cases_)