class_docstr: Unit test for Google Test's XML output functionality.
class_docstr_tok: ["Unit","test","for","Google","Test","'s","XML","output","functionality","."]
docstr: Checks whether the timestamp attribute in the XML output is valid.
  
  Runs a test program that generates an empty XML output, and checks if
  the timestamp attribute in the testsuites tag is valid.
docstr_tok: ["Checks","whether","the","timestamp","attribute","in","the","XML","output","is","valid",".","Runs","a","test","program","that","generates","an","empty","XML","output",",","and","checks","if","the","timestamp","attribute","in","the","testsuites","tag","is","valid","."]
code: def testTimestampValue(self):
      """Checks whether the timestamp attribute in the XML output is valid.
  
      Runs a test program that generates an empty XML output, and checks if
      the timestamp attribute in the testsuites tag is valid.
      """
      actual = self._GetXmlOutput("gtest_no_test_unittest", [], {}, 0)
      date_time_str = actual.documentElement.getAttributeNode(
          "timestamp"
      ).value
      # datetime.strptime() is only available in Python 2.5+ so we have to
      # parse the expected datetime manually.
      match = re.match(
          r"(\d+)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)", date_time_str
      )
      self.assertTrue(
          re.match,
          "XML datettime string %s has incorrect format"
          % date_time_str,
      )
      date_time_from_xml = datetime.datetime(
          year=int(match.group(1)),
          month=int(match.group(2)),
          day=int(match.group(3)),
          hour=int(match.group(4)),
          minute=int(match.group(5)),
          second=int(match.group(6)),
      )
  
      time_delta = abs(datetime.datetime.now() - date_time_from_xml)
      # timestamp value should be near the current local time
      self.assertLess(time_delta, datetime.timedelta(seconds=600))
      actual.unlink()
  
file_path: open-asset-importer/contrib/googletest/googletest/test/gtest_xml_output_unittest.py
imports: import datetime
  import errno
  import os
  import re
  import sys
  from xml.dom import minidom, Node
  from googletest.test import gtest_test_utils
  from googletest.test import gtest_xml_test_utils
label_desc: Use image node_id 2 for calling the GTestXMLOutputUnitTest obj's underlying member method code with example usage: obj.testTimestampValue() without return types