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)
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)
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)
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)
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)
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]
def test_write_xml_gen(self, tmpdir): dirname = str(tmpdir) utils.write_xml("<xml />", output_loc=dirname) assert "output-" in os.listdir(dirname)[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]
def test_write_xml_gen(self, tmpdir): dirname = str(tmpdir) utils.write_xml('<xml />', output_loc=dirname) assert 'output-' in os.listdir(dirname)[0]