How to use microsoft method in locust

Best Python code snippet using locust

test_merge_templates.py

Source:test_merge_templates.py Github

copy

Full Screen

1import unittest2import tempfile3from os import path4from lxml import etree5from mailmerge import MailMerge6from tests.utils import EtreeMixin, get_document_body_part7class MergeListTest(EtreeMixin, unittest.TestCase):8 def test_break_page(self):9 with MailMerge(path.join(path.dirname(__file__), 'test_merge_templates_simple.docx')) as document:10 self.assertEqual(document.get_merge_fields(), {'fieldname'})11 document.merge_templates([12 {'fieldname': "Test with page_break"},13 {'fieldname': "abc"},14 {'fieldname': "2b v ~2b"},15 ], 'page_break')16 with tempfile.TemporaryFile() as outfile:17 document.write(outfile)18 expected_tree = etree.fromstring('<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>Test with page_break</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:r><w:br w:type="page"/></w:r></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>abc</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:r><w:br w:type="page"/></w:r></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>2b v ~2b</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:type w:val="continuous"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/></w:sectPr></w:body></w:document>') # noqa19 self.assert_equal_tree(expected_tree, get_document_body_part(document).getroot())20 def test_break_col(self):21 with MailMerge(path.join(path.dirname(__file__), 'test_merge_templates_simple.docx')) as document:22 self.assertEqual(document.get_merge_fields(), {'fieldname'})23 document.merge_templates([24 {'fieldname': "Test with column_break"},25 {'fieldname': "abc"},26 {'fieldname': "2b v ~2b"},27 ], 'column_break')28 with tempfile.TemporaryFile() as outfile:29 document.write(outfile)30 expected_tree = etree.fromstring('<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>Test with column_break</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:r><w:br w:type="column"/></w:r></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>abc</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:r><w:br w:type="column"/></w:r></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>2b v ~2b</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:type w:val="continuous"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/></w:sectPr></w:body></w:document>') # noqa31 self.assert_equal_tree(expected_tree, get_document_body_part(document).getroot())32 def test_break_tW(self):33 with MailMerge(path.join(path.dirname(__file__), 'test_merge_templates_simple.docx')) as document:34 self.assertEqual(document.get_merge_fields(), {'fieldname'})35 document.merge_templates([36 {'fieldname': "Test with textWrapping_break"},37 {'fieldname': "abc"},38 {'fieldname': "2b v ~2b"},39 ], 'textWrapping_break')40 with tempfile.TemporaryFile() as outfile:41 document.write(outfile)42 expected_tree = etree.fromstring('<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>Test with textWrapping_break</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:r><w:br w:type="textWrapping"/></w:r></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>abc</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:r><w:br w:type="textWrapping"/></w:r></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>2b v ~2b</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:type w:val="continuous"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/></w:sectPr></w:body></w:document>') # noqa43 self.assert_equal_tree(expected_tree, get_document_body_part(document).getroot())44 def test_sect_page(self):45 with MailMerge(path.join(path.dirname(__file__), 'test_merge_templates_simple.docx')) as document:46 self.assertEqual(document.get_merge_fields(), {'fieldname'})47 document.merge_templates([48 {'fieldname': "Test with nextPage_section"},49 {'fieldname': "abc"},50 {'fieldname': "2b v ~2b"},51 ], 'nextPage_section')52 with tempfile.TemporaryFile() as outfile:53 document.write(outfile)54 expected_tree = etree.fromstring('<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>Test with nextPage_section</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:pPr><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="nextPage"/></w:sectPr></w:pPr></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>abc</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:pPr><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="nextPage"/></w:sectPr></w:pPr></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>2b v ~2b</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="nextPage"/></w:sectPr></w:body></w:document>') # noqa55 self.assert_equal_tree(expected_tree, get_document_body_part(document).getroot())56 def test_sect_cont(self):57 with MailMerge(path.join(path.dirname(__file__), 'test_merge_templates_simple.docx')) as document:58 self.assertEqual(document.get_merge_fields(), {'fieldname'})59 document.merge_templates([60 {'fieldname': "Test with continuous_section"},61 {'fieldname': "abc"},62 {'fieldname': "2b v ~2b"},63 ], 'continuous_section')64 with tempfile.TemporaryFile() as outfile:65 document.write(outfile)66 expected_tree = etree.fromstring('<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>Test with continuous_section</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:pPr><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="continuous"/></w:sectPr></w:pPr></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>abc</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:pPr><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="continuous"/></w:sectPr></w:pPr></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>2b v ~2b</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="continuous"/></w:sectPr></w:body></w:document>') # noqa67 self.assert_equal_tree(expected_tree, get_document_body_part(document).getroot())68 def test_sect_eP(self):69 with MailMerge(path.join(path.dirname(__file__), 'test_merge_templates_simple.docx')) as document:70 self.assertEqual(document.get_merge_fields(), {'fieldname'})71 document.merge_templates([72 {'fieldname': "Test with evenPage_section"},73 {'fieldname': "abc"},74 {'fieldname': "2b v ~2b"},75 ], 'evenPage_section')76 with tempfile.TemporaryFile() as outfile:77 document.write(outfile)78 expected_tree = etree.fromstring('<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>Test with evenPage_section</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:pPr><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="evenPage"/></w:sectPr></w:pPr></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>abc</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:pPr><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="evenPage"/></w:sectPr></w:pPr></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>2b v ~2b</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="evenPage"/></w:sectPr></w:body></w:document>') # noqa79 self.assert_equal_tree(expected_tree, get_document_body_part(document).getroot())80 def test_sect_oP(self):81 with MailMerge(path.join(path.dirname(__file__), 'test_merge_templates_simple.docx')) as document:82 self.assertEqual(document.get_merge_fields(), {'fieldname'})83 document.merge_templates([84 {'fieldname': "Test with oddPage_section"},85 {'fieldname': "abc"},86 {'fieldname': "2b v ~2b"},87 ], 'oddPage_section')88 with tempfile.TemporaryFile() as outfile:89 document.write(outfile)90 expected_tree = etree.fromstring('<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>Test with oddPage_section</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:pPr><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="oddPage"/></w:sectPr></w:pPr></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>abc</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:pPr><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="oddPage"/></w:sectPr></w:pPr></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>2b v ~2b</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="oddPage"/></w:sectPr></w:body></w:document>') # noqa91 self.assert_equal_tree(expected_tree, get_document_body_part(document).getroot())92 def test_sect_col(self):93 with MailMerge(path.join(path.dirname(__file__), 'test_merge_templates_simple.docx')) as document:94 self.assertEqual(document.get_merge_fields(), {'fieldname'})95 document.merge_templates([96 {'fieldname': "Test with nextColumn_section"},97 {'fieldname': "abc"},98 {'fieldname': "2b v ~2b"},99 ], 'nextColumn_section')100 with tempfile.TemporaryFile() as outfile:101 document.write(outfile)102 expected_tree = etree.fromstring('<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>Test with nextColumn_section</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:pPr><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="nextColumn"/></w:sectPr></w:pPr></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>abc</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:p><w:pPr><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="nextColumn"/></w:sectPr></w:pPr></w:p><w:p w:rsidR="005D67CE" w:rsidRDefault="00C83F78" w:rsidP="007B2B98"><w:pPr><w:rPr><w:noProof/></w:rPr></w:pPr><w:proofErr w:type="gramStart"/><w:r><w:t>Merge :</w:t></w:r><w:proofErr w:type="gramEnd"/><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>2b v ~2b</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/></w:p><w:sectPr w:rsidR="005D67CE" w:rsidSect="00431D2A"><w:headerReference w:type="default" r:id="rId6"/><w:footerReference w:type="default" r:id="rId7"/><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="709"/><w:docGrid w:linePitch="360"/><w:type w:val="nextColumn"/></w:sectPr></w:body></w:document>') # noqa...

Full Screen

Full Screen

get_provider_info.py

Source:get_provider_info.py Github

copy

Full Screen

1# Licensed to the Apache Software Foundation (ASF) under one2# or more contributor license agreements. See the NOTICE file3# distributed with this work for additional information4# regarding copyright ownership. The ASF licenses this file5# to you under the Apache License, Version 2.0 (the6# "License"); you may not use this file except in compliance7# with the License. You may obtain a copy of the License at8#9# http://www.apache.org/licenses/LICENSE-2.010#11# Unless required by applicable law or agreed to in writing,12# software distributed under the License is distributed on an13# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY14# KIND, either express or implied. See the License for the15# specific language governing permissions and limitations16# under the License.17def get_provider_info():18 return {19 'package-name': 'apache-airflow-providers-microsoft-azure',20 'name': 'Microsoft Azure',21 'description': '`Microsoft Azure <https://azure.microsoft.com/>`__\n',22 'versions': ['1.0.0'],23 'integrations': [24 {25 'integration-name': 'Microsoft Azure Batch',26 'external-doc-url': 'https://azure.microsoft.com/en-us/services/batch/',27 'tags': ['azure'],28 },29 {30 'integration-name': 'Microsoft Azure Blob Storage',31 'external-doc-url': 'https://azure.microsoft.com/en-us/services/storage/blobs/',32 'tags': ['azure'],33 },34 {35 'integration-name': 'Microsoft Azure Container Instances',36 'external-doc-url': 'https://azure.microsoft.com/en-us/services/container-instances/',37 'tags': ['azure'],38 },39 {40 'integration-name': 'Microsoft Azure Cosmos DB',41 'external-doc-url': 'https://azure.microsoft.com/en-us/services/cosmos-db/',42 'tags': ['azure'],43 },44 {45 'integration-name': 'Microsoft Azure Data Explorer',46 'external-doc-url': 'https://azure.microsoft.com/en-us/services/data-explorer/',47 'tags': ['azure'],48 },49 {50 'integration-name': 'Microsoft Azure Data Lake Storage',51 'external-doc-url': 'https://azure.microsoft.com/en-us/services/storage/data-lake-storage/',52 'tags': ['azure'],53 },54 {55 'integration-name': 'Microsoft Azure Files',56 'external-doc-url': 'https://azure.microsoft.com/en-us/services/storage/files/',57 'tags': ['azure'],58 },59 {60 'integration-name': 'Microsoft Azure FileShare',61 'external-doc-url': 'https://cloud.google.com/storage/',62 'tags': ['azure'],63 },64 {65 'integration-name': 'Microsoft Azure',66 'external-doc-url': 'https://azure.microsoft.com/',67 'tags': ['azure'],68 },69 ],70 'operators': [71 {72 'integration-name': 'Microsoft Azure Data Lake Storage',73 'python-modules': ['airflow.providers.microsoft.azure.operators.adls_list'],74 },75 {76 'integration-name': 'Microsoft Azure Data Explorer',77 'python-modules': ['airflow.providers.microsoft.azure.operators.adx'],78 },79 {80 'integration-name': 'Microsoft Azure Batch',81 'python-modules': ['airflow.providers.microsoft.azure.operators.azure_batch'],82 },83 {84 'integration-name': 'Microsoft Azure Container Instances',85 'python-modules': ['airflow.providers.microsoft.azure.operators.azure_container_instances'],86 },87 {88 'integration-name': 'Microsoft Azure Cosmos DB',89 'python-modules': ['airflow.providers.microsoft.azure.operators.azure_cosmos'],90 },91 {92 'integration-name': 'Microsoft Azure Blob Storage',93 'python-modules': ['airflow.providers.microsoft.azure.operators.wasb_delete_blob'],94 },95 ],96 'sensors': [97 {98 'integration-name': 'Microsoft Azure Cosmos DB',99 'python-modules': ['airflow.providers.microsoft.azure.sensors.azure_cosmos'],100 },101 {102 'integration-name': 'Microsoft Azure Blob Storage',103 'python-modules': ['airflow.providers.microsoft.azure.sensors.wasb'],104 },105 ],106 'hooks': [107 {108 'integration-name': 'Microsoft Azure Container Instances',109 'python-modules': [110 'airflow.providers.microsoft.azure.hooks.azure_container_volume',111 'airflow.providers.microsoft.azure.hooks.azure_container_registry',112 'airflow.providers.microsoft.azure.hooks.azure_container_instance',113 ],114 },115 {116 'integration-name': 'Microsoft Azure Data Explorer',117 'python-modules': ['airflow.providers.microsoft.azure.hooks.adx'],118 },119 {120 'integration-name': 'Microsoft Azure FileShare',121 'python-modules': ['airflow.providers.microsoft.azure.hooks.azure_fileshare'],122 },123 {124 'integration-name': 'Microsoft Azure',125 'python-modules': ['airflow.providers.microsoft.azure.hooks.base_azure'],126 },127 {128 'integration-name': 'Microsoft Azure Batch',129 'python-modules': ['airflow.providers.microsoft.azure.hooks.azure_batch'],130 },131 {132 'integration-name': 'Microsoft Azure Data Lake Storage',133 'python-modules': ['airflow.providers.microsoft.azure.hooks.azure_data_lake'],134 },135 {136 'integration-name': 'Microsoft Azure Cosmos DB',137 'python-modules': ['airflow.providers.microsoft.azure.hooks.azure_cosmos'],138 },139 {140 'integration-name': 'Microsoft Azure Blob Storage',141 'python-modules': ['airflow.providers.microsoft.azure.hooks.wasb'],142 },143 ],144 'transfers': [145 {146 'source-integration-name': 'Local',147 'target-integration-name': 'Microsoft Azure Data Lake Storage',148 'how-to-guide': '/docs/apache-airflow-providers-microsoft-azure/operators/local_to_adls.rst',149 'python-module': 'airflow.providers.microsoft.azure.transfers.local_to_adls',150 },151 {152 'source-integration-name': 'Oracle',153 'target-integration-name': 'Microsoft Azure Data Lake Storage',154 'python-module': 'airflow.providers.microsoft.azure.transfers.oracle_to_azure_data_lake',155 },156 {157 'source-integration-name': 'Local',158 'target-integration-name': 'Microsoft Azure Blob Storage',159 'python-module': 'airflow.providers.microsoft.azure.transfers.file_to_wasb',160 },161 {162 'source-integration-name': 'Microsoft Azure Blob Storage',163 'target-integration-name': 'Google Cloud Storage (GCS)',164 'how-to-guide': '/docs/apache-airflow-providers-microsoft-azure/operators/azure_blob_to_gcs.rst',165 'python-module': 'airflow.providers.microsoft.azure.transfers.azure_blob_to_gcs',166 },167 ],168 'hook-class-names': [169 'airflow.providers.microsoft.azure.hooks.base_azure.AzureBaseHook',170 'airflow.providers.microsoft.azure.hooks.adx.AzureDataExplorerHook',171 'airflow.providers.microsoft.azure.hooks.azure_batch.AzureBatchHook',172 'airflow.providers.microsoft.azure.hooks.azure_cosmos.AzureCosmosDBHook',173 'airflow.providers.microsoft.azure.hooks.azure_data_lake.AzureDataLakeHook',174 'airflow.providers.microsoft.azure.hooks.azure_container_instance.AzureContainerInstanceHook',175 'airflow.providers.microsoft.azure.hooks.wasb.WasbHook',176 ],...

Full Screen

Full Screen

test.py

Source:test.py Github

copy

Full Screen

1import collections2from nltk import word_tokenize3from nltk.corpus import stopwords4from nltk.stem.wordnet import WordNetLemmatizer5from sklearn.cluster import KMeans6from sklearn.feature_extraction.text import TfidfVectorizer78910example = ['PWC cust connect frozen', 'PWC Cust connect frozen', 'PWC Cust connect frozen', 'cust connect frozen',11'Cust connect frozen', 'PEC cust connect frozen', 'Pwc Cust connect frozen', 'PWC cust connect frozen tfsa not loading',12'PWC cust connect frozen error 103','OC - unable to open file on network drive',13'OCSC - missing network drive',14'URGENT OC - unable to access files on network drive',15'OC - Network drive not mapped',16'USOC - windows - add network Drive',17'MI - Cannot Access Network Drive',18'How to gain access to a network drive.',19'M&I Connect - Map network drive and printer',20'USOC - How To map network drive',21'Map network drive request',22'request to map network drive',23'user needs to be mapped to network drive',24'request to map network drive',25'How to get access to a shared network drive.',26'How to get access to a shared network drive.',27'MICROSOFT PATCH UPDATE CMRI70297350',28'MICROSOFT PATCH UPDATE CMRI70297350',29'MICROSOFT PATCH UPDATE CMRI70297357',30'MICROSOFT PATCH UPDATE CMRI70297357',31'MICROSOFT PATCH UPDATE CMRI70361938',32'MICROSOFT PATCH UPDATE CMRI70361938',33'MICROSOFT PATCH UPDATE CMRI70394042',34'MICROSOFT PATCH UPDATE CMRI70394042',35'MICROSOFT PATCH UPDATE CMRI70297352',36'MICROSOFT PATCH UPDATE CMRI70297352',37'MICROSOFT PATCH UPDATE CMRI70394086',38'MICROSOFT PATCH UPDATE CMRI70394086',39'MICROSOFT PATCH UPDATE CMRI70394048',40'MICROSOFT PATCH UPDATE CMRI70394048',41'MICROSOFT PATCH UPDATE CMRI70360996',42'MICROSOFT PATCH UPDATE CMRI70360996',43'MICROSOFT PATCH UPDATE CMRI70394045',44'MICROSOFT PATCH UPDATE CMRI70394045',45'MICROSOFT PATCH UPDATE CMRI70394055',46'MICROSOFT PATCH UPDATE CMRI70394055',47'MICROSOFT PATCH UPDATE CMRI70407062',48'MICROSOFT PATCH UPDATE CMRI70407062',49'MICROSOFT PATCH UPDATE CMRI70407083',50'MICROSOFT PATCH UPDATE CMRI70407083',51'MICROSOFT PATCH UPDATE CMRI70407114',52'MICROSOFT PATCH UPDATE CMRI70407114',53'MICROSOFT PATCH UPDATE CMRI70407182',54'MICROSOFT PATCH UPDATE CMRI70407182',55'MICROSOFT PATCH UPDATE CMRI70394083',56'MICROSOFT PATCH UPDATE CMRI70394083',57'MICROSOFT PATCH UPDATE CMRI70407108',58'MICROSOFT PATCH UPDATE CMRI70407108',59'MICROSOFT PATCH UPDATE CMRI70407187',60'MICROSOFT PATCH UPDATE CMRI70407187',61'MICROSOFT PATCH UPDATE CMRI70394041',62'MICROSOFT PATCH UPDATE CMRI70394041',63'MICROSOFT PATCH UPDATE CMRI70394087',64'MICROSOFT PATCH UPDATE CMRI70394087',65'MICROSOFT PATCH UPDATE CMRI70407055',66'MICROSOFT PATCH UPDATE CMRI70407055',67'MICROSOFT PATCH UPDATE CMRI70407074',68'MICROSOFT PATCH UPDATE CMRI70407074',69'MICROSOFT PATCH UPDATE CMRI70407110',70'MICROSOFT PATCH UPDATE CMRI70407110',71'MICROSOFT PATCH UPDATE CMRI70407183',72'MICROSOFT PATCH UPDATE CMRI70407183',73'MICROSOFT PATCH UPDATE CMRI70407192',74'MICROSOFT PATCH UPDATE CMRI70407192',75'MICROSOFT PATCH UPDATE CMRI70407193',76'MICROSOFT PATCH UPDATE CMRI70407193',77'MICROSOFT PATCH UPDATE CMRI70407194',78'MICROSOFT PATCH UPDATE CMRI70407194',79'MICROSOFT PATCH UPDATE CMRI70407239',80'MICROSOFT PATCH UPDATE CMRI70407239',81'MICROSOFT PATCH UPDATE CMRI70407212',82'MICROSOFT PATCH UPDATE CMRI70407212',83'MICROSOFT PATCH UPDATE CMRI70407209',84'MICROSOFT PATCH UPDATE CMRI70407209',85'MICROSOFT PATCH UPDATE CMRI70407210',86'MICROSOFT PATCH UPDATE CMRI70407210',87'MICROSOFT PATCH UPDATE CMRI70407211',88'MICROSOFT PATCH UPDATE CMRI70407211',89'MICROSOFT PATCH UPDATE CMRI70407216',90'MICROSOFT PATCH UPDATE CMRI70407216',91'MICROSOFT PATCH UPDATE CMRI70407218',92'MICROSOFT PATCH UPDATE CMRI70407218',93'MICROSOFT PATCH UPDATE CMRI70407237',94'MICROSOFT PATCH UPDATE CMRI70407237',95'MICROSOFT PATCH UPDATE CMRI70407414',96'MICROSOFT PATCH UPDATE CMRI70407414',97'MICROSOFT PATCH UPDATE CMRI70407415',98'MICROSOFT PATCH UPDATE CMRI70407415',99'MICROSOFT PATCH UPDATE CMRI70407170',100'MICROSOFT PATCH UPDATE CMRI70407170',101'MICROSOFT PATCH UPDATE CMRI70407422',102'MICROSOFT PATCH UPDATE CMRI70407422',103'MICROSOFT PATCH UPDATE CMRI70407423',104'MICROSOFT PATCH UPDATE CMRI70407423',105'MICROSOFT PATCH UPDATE CMRI70407206',106'MICROSOFT PATCH UPDATE CMRI70407206',107'MICROSOFT PATCH UPDATE CMRI70407246',108'MICROSOFT PATCH UPDATE CMRI70407246',109'MICROSOFT PATCH UPDATE CMRI70407249',110'MICROSOFT PATCH UPDATE CMRI70407249',111'MICROSOFT PATCH UPDATE CMRI70407252',112'MICROSOFT PATCH UPDATE CMRI70407252',113'MICROSOFT PATCH UPDATE CMRI70407409',114'MICROSOFT PATCH UPDATE CMRI70407409',115'MICROSOFT PATCH UPDATE CMRI70407417',116'MICROSOFT PATCH UPDATE CMRI70407417',117'MICROSOFT PATCH UPDATE CMRI70407424',118'MICROSOFT PATCH UPDATE CMRI70407424',119'MICROSOFT PATCH UPDATE CMRI70407461',120'MICROSOFT PATCH UPDATE CMRI70407461',121'MICROSOFT PATCH UPDATE CMRI70428274',122'MICROSOFT PATCH UPDATE CMRI70428274',123'MICROSOFT PATCH UPDATE CMRI70428355',124'MICROSOFT PATCH UPDATE CMRI70428355',125'MICROSOFT PATCH UPDATE CMRI70428408',126'MICROSOFT PATCH UPDATE CMRI70428408',127'MICROSOFT PATCH UPDATE CMRI70428211',128'MICROSOFT PATCH UPDATE CMRI70428211',129'MICROSOFT PATCH UPDATE CMRI70428380',130'MICROSOFT PATCH UPDATE CMRI70428380',131'MICROSOFT PATCH UPDATE CMRI70428414',132'MICROSOFT PATCH UPDATE CMRI70428414',133'MICROSOFT PATCH UPDATE CMRI70428465',134'MICROSOFT PATCH UPDATE CMRI70428465',135'MICROSOFT PATCH UPDATE CMRI70428484',136'MICROSOFT PATCH UPDATE CMRI70428484',137'MICROSOFT PATCH UPDATE CMRI70394069',138'MICROSOFT PATCH UPDATE CMRI70394069',139'MICROSOFT PATCH UPDATE CMRI70407035',140'MICROSOFT PATCH UPDATE CMRI70407035',141'MICROSOFT PATCH UPDATE CMRI70428542',142'MICROSOFT PATCH UPDATE CMRI70428542',143'MICROSOFT PATCH UPDATE CMRI70436679',144'MICROSOFT PATCH UPDATE CMRI70436679',145'MICROSOFT PATCH UPDATE CMRI70428200',146'MICROSOFT PATCH UPDATE CMRI70428200',147'MICROSOFT PATCH UPDATE CMRI70428252',148'MICROSOFT PATCH UPDATE CMRI70428252']149150# tokenizer function151def wrd_tknizer(sen):152 tokens = word_tokenize(sen)153 print('1111111111111111111')154 print(tokens)155 print('1111111111111111111')156 lmtzed_tokens = [lemmatizer.lemmatize(t) for t in tokens if t not in stopwords.words('english')]157 print('22222222222222222222')158 print(lmtzed_tokens)159 print('22222222222222222222')160 return lmtzed_tokens161162 ...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run locust automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful