Ejemplo n.º 1
0
 def write_xml(self,
               xml_str: str,
               output_file: Optional[str] = None) -> None:
     """Output the XML content into a file."""
     gen_filename = "testrun_{}-{:%Y%m%d%H%M%S}.xml".format(
         self.testrun_id, datetime.datetime.now())
     utils.write_xml(xml_str, output_loc=output_file, filename=gen_filename)
Ejemplo n.º 2
0
 def write_xml(xml, output_file=None):
     """Outputs the XML content into a file."""
     gen_filename = "requirements-{:%Y%m%d%H%M%S}.xml".format(
         datetime.datetime.now())
     utils.write_xml(xml, output_loc=output_file, filename=gen_filename)
Ejemplo n.º 3
0
 def write_xml(self, xml, output_file=None):
     """Outputs the XML content into a file."""
     gen_filename = 'testrun_{}-{:%Y%m%d%H%M%S}.xml'.format(
         self.testrun_id, datetime.datetime.now())
     utils.write_xml(xml, output_loc=output_file, filename=gen_filename)
Ejemplo n.º 4
0
 def write_xml(xml_str: str, output_file: Optional[str] = None) -> None:
     """Output the XML content into a file."""
     gen_filename = "requirements-{:%Y%m%d%H%M%S}.xml".format(
         datetime.datetime.now())
     utils.write_xml(xml_str, output_loc=output_file, filename=gen_filename)
Ejemplo n.º 5
0
 def test_write_xml_no_data(self, tmpdir):
     dirname = str(tmpdir)
     with pytest.raises(Dump2PolarionException) as excinfo:
         utils.write_xml("",
                         filename=os.path.join(dirname, "output123.xml"))
     assert "No data to write" in str(excinfo.value)
Ejemplo n.º 6
0
 def test_write_xml_file(self, tmpdir):
     dirname = str(tmpdir)
     utils.write_xml("<xml />",
                     filename=os.path.join(dirname, "output123.xml"))
     assert "output123.xml" in os.listdir(dirname)[0]
Ejemplo n.º 7
0
 def test_write_xml_gen(self, tmpdir):
     dirname = str(tmpdir)
     utils.write_xml("<xml />", output_loc=dirname)
     assert "output-" in os.listdir(dirname)[0]
Ejemplo n.º 8
0
 def test_write_xml_file(self, tmpdir):
     dirname = str(tmpdir)
     utils.write_xml('<xml />',
                     filename=os.path.join(dirname, 'output123.xml'))
     assert 'output123.xml' in os.listdir(dirname)[0]
Ejemplo n.º 9
0
 def test_write_xml_gen(self, tmpdir):
     dirname = str(tmpdir)
     utils.write_xml('<xml />', output_loc=dirname)
     assert 'output-' in os.listdir(dirname)[0]