コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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)
コード例 #5
0
ファイル: test_utils.py プロジェクト: lian-heng/dump2polarion
 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)
コード例 #6
0
ファイル: test_utils.py プロジェクト: lian-heng/dump2polarion
 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]
コード例 #7
0
ファイル: test_utils.py プロジェクト: lian-heng/dump2polarion
 def test_write_xml_gen(self, tmpdir):
     dirname = str(tmpdir)
     utils.write_xml("<xml />", output_loc=dirname)
     assert "output-" in os.listdir(dirname)[0]
コード例 #8
0
ファイル: test_utils.py プロジェクト: mshriver/dump2polarion
 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]
コード例 #9
0
ファイル: test_utils.py プロジェクト: mshriver/dump2polarion
 def test_write_xml_gen(self, tmpdir):
     dirname = str(tmpdir)
     utils.write_xml('<xml />', output_loc=dirname)
     assert 'output-' in os.listdir(dirname)[0]