Fix and update tests

This commit is contained in:
Veronica K. B. Olsen
2021-02-10 16:57:32 +01:00
parent ec189a4867
commit 672ea6d6f2
8 changed files with 85 additions and 78 deletions
@@ -5,17 +5,17 @@
<title>Lorem Ipsum</title>
</head>
<style>
body {font-family: 'DejaVu Sans'; font-size: 11pt}
p {text-align: left;}
h1, h2 {color: rgb(66, 113, 174);}
h3, h4 {color: rgb(50, 50, 50);}
h1, h2, h3, h4 {page-break-after: avoid;}
body {font-family: 'DejaVu Sans'; font-size: 11pt;}
p {text-align: left; line-height: 115%; margin-top: 0.00em; margin-bottom: 0.58em;}
h1 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 1.00em; margin-bottom: 0.50em;}
h2 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 0.83em; margin-bottom: 0.50em;}
h3 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 0.58em; margin-bottom: 0.50em;}
h4 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 0.58em; margin-bottom: 0.50em;}
.title {font-size: 2.5em; margin-top: 1.00em; margin-bottom: 0.50em;}
.sep, .skip {text-align: center; margin-top: 1.00em; margin-bottom: 1.00em;}
a {color: rgb(66, 113, 174);}
.title {font-size: 2.5em;}
.tags {color: rgb(245, 135, 31); font-weight: bold;}
.break {text-align: left;}
.sep {text-align: center; margin-top: 1em; margin-bottom: 1em;}
.skip {margin-top: 1em; margin-bottom: 1em;}
.synopsis {font-style: italic;}
.comment {font-style: italic; color: rgb(100, 100, 100);}
article {width: 800px; margin: 40px auto;}
@@ -24,8 +24,8 @@ article {width: 800px; margin: 40px auto;}
<article>
<h1 class='title' style='text-align: center; page-break-before: auto;'>Lorem Ipsum</h1>
<p style='text-align: center;'><strong>By lipsum.com</strong></p>
<p style='text-align: center;'>“Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit&hellip;</p>
<p style='text-align: center;'>“There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain&hellip;</p>
<p style='text-align: center;'>“Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit</p>
<p style='text-align: center;'>“There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain</p>
<p style='text-align: left;'>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, “Lorem ipsum dolor sit amet..”, comes from a line in section 1.10.32.</p>
<p style='text-align: left;'>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from “de Finibus Bonorum et Malorum” by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>
<h1 style='page-break-before: always;'>Prologue</h1>
@@ -5,17 +5,17 @@
<title>Lorem Ipsum</title>
</head>
<style>
body {font-family: 'DejaVu Sans'; font-size: 11pt}
p {text-align: justify;}
h1, h2 {color: rgb(66, 113, 174);}
h3, h4 {color: rgb(50, 50, 50);}
h1, h2, h3, h4 {page-break-after: avoid;}
body {font-family: 'DejaVu Sans'; font-size: 11pt;}
p {text-align: justify; line-height: 115%; margin-top: 0.00em; margin-bottom: 0.58em;}
h1 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 1.00em; margin-bottom: 0.50em;}
h2 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 0.83em; margin-bottom: 0.50em;}
h3 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 0.58em; margin-bottom: 0.50em;}
h4 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 0.58em; margin-bottom: 0.50em;}
.title {font-size: 2.5em; margin-top: 1.00em; margin-bottom: 0.50em;}
.sep, .skip {text-align: center; margin-top: 1.00em; margin-bottom: 1.00em;}
a {color: rgb(66, 113, 174);}
.title {font-size: 2.5em;}
.tags {color: rgb(245, 135, 31); font-weight: bold;}
.break {text-align: left;}
.sep {text-align: center; margin-top: 1em; margin-bottom: 1em;}
.skip {margin-top: 1em; margin-bottom: 1em;}
.synopsis {font-style: italic;}
.comment {font-style: italic; color: rgb(100, 100, 100);}
article {width: 800px; margin: 40px auto;}
@@ -24,16 +24,16 @@ article {width: 800px; margin: 40px auto;}
<article>
<h1 class='title' style='text-align: center; page-break-before: auto;'>Lorem Ipsum</h1>
<p style='text-align: center;'><strong>By lipsum.com</strong></p>
<p style='text-align: center;'>Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit&hellip;</p>
<p style='text-align: center;'>There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain&hellip;</p>
<p style='text-align: center;'>&ldquo;Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit&hellip;&rdquo;</p>
<p style='text-align: center;'>&ldquo;There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain&hellip;&rdquo;</p>
<p class='comment'><strong>Comment:</strong> Exctracted from the lipsum.com website.</p>
<p style='text-align: left;'>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of de Finibus Bonorum et Malorum (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, Lorem ipsum dolor sit amet.., comes from a line in section 1.10.32.</p>
<p style='text-align: left;'>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from de Finibus Bonorum et Malorum by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>
<p style='text-align: left;'>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of &ldquo;de Finibus Bonorum et Malorum&rdquo; (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, &ldquo;Lorem ipsum dolor sit amet..&rdquo;, comes from a line in section 1.10.32.</p>
<p style='text-align: left;'>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from &ldquo;de Finibus Bonorum et Malorum&rdquo; by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>
<h1 style='page-break-before: always;'>Prologue</h1>
<p class='synopsis'><strong>Synopsis:</strong> Explanation from the lipsum.com website.</p>
<p><em>Lorem Ipsum</em> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p><em>Lorem Ipsum</em> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&#39;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<h1 style='text-align: center; page-break-before: always;'>Act One</h1>
<p style='text-align: center;'>Fusce maximus felis libero</p>
<p style='text-align: center;'>&ldquo;Fusce maximus felis libero&rdquo;</p>
<h1 style='page-break-before: always;'>Chapter One: Chapter One</h1>
<p style='margin-bottom: 0;'><span class='tags'>Point of View:</span> <a href='#tag_Bod'>Bod</a></p>
<p style='margin-bottom: 0; margin-top: 0;'><span class='tags'>Plot:</span> <a href='#tag_Main'>Main</a></p>
@@ -65,8 +65,8 @@ article {width: 800px; margin: 40px auto;}
<h1 style='page-break-before: always;'>Chapter Two: Why do we use it?</h1>
<p class='comment'><strong>Comment:</strong> Exctracted from the lipsum.com website.</p>
<p>&#09;It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.</p>
<p>&#09;The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.</p>
<p>&#09;Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
<p>&#09;The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using &#39;Content here, content here&#39;, making it look like readable English.</p>
<p>&#09;Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for &#39;lorem ipsum&#39; will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
<h1 style='page-break-before: always;'>Chapter Three: Chapter Two</h1>
<p style='margin-bottom: 0;'><span class='tags'>Point of View:</span> <a href='#tag_Bod'>Bod</a></p>
<p style='margin-bottom: 0; margin-top: 0;'><span class='tags'>Plot:</span> <a href='#tag_Main'>Main</a></p>
@@ -5,17 +5,17 @@
<title>Lorem Ipsum</title>
</head>
<style>
body {font-family: 'DejaVu Sans'; font-size: 11pt}
p {text-align: justify;}
h1, h2 {color: rgb(66, 113, 174);}
h3, h4 {color: rgb(50, 50, 50);}
h1, h2, h3, h4 {page-break-after: avoid;}
body {font-family: 'DejaVu Sans'; font-size: 11pt;}
p {text-align: justify; line-height: 115%; margin-top: 0.00em; margin-bottom: 0.58em;}
h1 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 1.00em; margin-bottom: 0.50em;}
h2 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 0.83em; margin-bottom: 0.50em;}
h3 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 0.58em; margin-bottom: 0.50em;}
h4 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 0.58em; margin-bottom: 0.50em;}
.title {font-size: 2.5em; margin-top: 1.00em; margin-bottom: 0.50em;}
.sep, .skip {text-align: center; margin-top: 1.00em; margin-bottom: 1.00em;}
a {color: rgb(66, 113, 174);}
.title {font-size: 2.5em;}
.tags {color: rgb(245, 135, 31); font-weight: bold;}
.break {text-align: left;}
.sep {text-align: center; margin-top: 1em; margin-bottom: 1em;}
.skip {margin-top: 1em; margin-bottom: 1em;}
.synopsis {font-style: italic;}
.comment {font-style: italic; color: rgb(100, 100, 100);}
article {width: 800px; margin: 40px auto;}
@@ -24,16 +24,16 @@ article {width: 800px; margin: 40px auto;}
<article>
<h1 class='title' style='text-align: center; page-break-before: auto;'>Lorem Ipsum</h1>
<p style='text-align: center;'><strong>By lipsum.com</strong></p>
<p style='text-align: center;'>Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit&hellip;</p>
<p style='text-align: center;'>There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain&hellip;</p>
<p style='text-align: center;'>&ldquo;Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit&hellip;&rdquo;</p>
<p style='text-align: center;'>&ldquo;There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain&hellip;&rdquo;</p>
<p class='comment'><strong>Comment:</strong> Exctracted from the lipsum.com website.</p>
<p style='text-align: left;'>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of de Finibus Bonorum et Malorum (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, Lorem ipsum dolor sit amet.., comes from a line in section 1.10.32.</p>
<p style='text-align: left;'>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from de Finibus Bonorum et Malorum by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>
<p style='text-align: left;'>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of &ldquo;de Finibus Bonorum et Malorum&rdquo; (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, &ldquo;Lorem ipsum dolor sit amet..&rdquo;, comes from a line in section 1.10.32.</p>
<p style='text-align: left;'>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from &ldquo;de Finibus Bonorum et Malorum&rdquo; by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</p>
<h1 style='page-break-before: always;'>Prologue</h1>
<p class='synopsis'><strong>Synopsis:</strong> Explanation from the lipsum.com website.</p>
<p><em>Lorem Ipsum</em> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p><em>Lorem Ipsum</em> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&#39;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<h1 style='text-align: center; page-break-before: always;'>Act One</h1>
<p style='text-align: center;'>Fusce maximus felis libero</p>
<p style='text-align: center;'>&ldquo;Fusce maximus felis libero&rdquo;</p>
<h1 style='page-break-before: always;'>Chapter One: Chapter One</h1>
<p style='margin-bottom: 0;'><span class='tags'>Point of View:</span> <a href='#tag_Bod'>Bod</a></p>
<p style='margin-bottom: 0; margin-top: 0;'><span class='tags'>Plot:</span> <a href='#tag_Main'>Main</a></p>
@@ -65,8 +65,8 @@ article {width: 800px; margin: 40px auto;}
<h1 style='page-break-before: always;'>Chapter Two: Why do we use it?</h1>
<p class='comment'><strong>Comment:</strong> Exctracted from the lipsum.com website.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using &#39;Content here, content here&#39;, making it look like readable English.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for &#39;lorem ipsum&#39; will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
<h1 style='page-break-before: always;'>Chapter Three: Chapter Two</h1>
<p style='margin-bottom: 0;'><span class='tags'>Point of View:</span> <a href='#tag_Bod'>Bod</a></p>
<p style='margin-bottom: 0; margin-top: 0;'><span class='tags'>Plot:</span> <a href='#tag_Main'>Main</a></p>
@@ -5,21 +5,21 @@
"authors": [
"lipsum.com"
],
"buildTime": 1611863279
"buildTime": 1612954696
},
"text": {
"css": [
"body {font-family: 'DejaVu Sans'; font-size: 11pt}",
"p {text-align: justify;}",
"h1, h2 {color: rgb(66, 113, 174);}",
"h3, h4 {color: rgb(50, 50, 50);}",
"h1, h2, h3, h4 {page-break-after: avoid;}",
"body {font-family: 'DejaVu Sans'; font-size: 11pt;}",
"p {text-align: justify; line-height: 115%; margin-top: 0.00em; margin-bottom: 0.58em;}",
"h1 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 1.00em; margin-bottom: 0.50em;}",
"h2 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 0.83em; margin-bottom: 0.50em;}",
"h3 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 0.58em; margin-bottom: 0.50em;}",
"h4 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 0.58em; margin-bottom: 0.50em;}",
".title {font-size: 2.5em; margin-top: 1.00em; margin-bottom: 0.50em;}",
".sep, .skip {text-align: center; margin-top: 1.00em; margin-bottom: 1.00em;}",
"a {color: rgb(66, 113, 174);}",
".title {font-size: 2.5em;}",
".tags {color: rgb(245, 135, 31); font-weight: bold;}",
".break {text-align: left;}",
".sep {text-align: center; margin-top: 1em; margin-bottom: 1em;}",
".skip {margin-top: 1em; margin-bottom: 1em;}",
".synopsis {font-style: italic;}",
".comment {font-style: italic; color: rgb(100, 100, 100);}"
],
@@ -5,17 +5,17 @@
<title>Lorem Ipsum</title>
</head>
<style>
body {font-family: 'DejaVu Sans'; font-size: 11pt}
p {text-align: justify;}
h1, h2 {color: rgb(66, 113, 174);}
h3, h4 {color: rgb(50, 50, 50);}
h1, h2, h3, h4 {page-break-after: avoid;}
body {font-family: 'DejaVu Sans'; font-size: 11pt;}
p {text-align: justify; line-height: 115%; margin-top: 0.00em; margin-bottom: 0.58em;}
h1 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 1.00em; margin-bottom: 0.50em;}
h2 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 0.83em; margin-bottom: 0.50em;}
h3 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 0.58em; margin-bottom: 0.50em;}
h4 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 0.58em; margin-bottom: 0.50em;}
.title {font-size: 2.5em; margin-top: 1.00em; margin-bottom: 0.50em;}
.sep, .skip {text-align: center; margin-top: 1.00em; margin-bottom: 1.00em;}
a {color: rgb(66, 113, 174);}
.title {font-size: 2.5em;}
.tags {color: rgb(245, 135, 31); font-weight: bold;}
.break {text-align: left;}
.sep {text-align: center; margin-top: 1em; margin-bottom: 1em;}
.skip {margin-top: 1em; margin-bottom: 1em;}
.synopsis {font-style: italic;}
.comment {font-style: italic; color: rgb(100, 100, 100);}
article {width: 800px; margin: 40px auto;}
+22 -17
View File
@@ -374,7 +374,7 @@ def testCoreToHtml_Complex(dummyGUI, fncDir):
for i in range(len(docText)):
theHtml.theText = docText[i]
theHtml.doAutoReplace()
theHtml.doPreProcessing()
theHtml.tokenizeText()
theHtml.doConvert()
assert theHtml.theResult == resText[i]
@@ -424,27 +424,32 @@ def testCoreToHtml_Methods(dummyGUI):
theHtml = ToHtml(theProject, dummyGUI)
theHtml.setKeepMarkdown(True)
# Auto-Replace
# Auto-Replace, keep Unicode
docText = "Text with <brackets> & shortdash, long—dash …\n"
theHtml.theText = docText
theHtml.doAutoReplace()
theHtml.setReplaceUnicode(False)
theHtml.doPreProcessing()
theHtml.tokenizeText()
theHtml.doConvert()
assert theHtml.theResult == (
"<p>Text with &lt;brackets&gt; &amp; shortdash, long—dash …</p>\n"
)
# Auto-Replace, replace Unicode
docText = "Text with <brackets> & shortdash, long—dash …\n"
theHtml.theText = docText
theHtml.setReplaceUnicode(True)
theHtml.doPreProcessing()
theHtml.tokenizeText()
theHtml.doConvert()
assert theHtml.theResult == (
"<p>Text with &lt;brackets&gt; &amp; short&ndash;dash, long&mdash;dash &hellip;</p>\n"
)
# Revert on MD
assert theHtml.theMarkdown[-1] == (
"Text with &lt;brackets&gt; &amp; short&ndash;dash, long&mdash;dash &hellip;\n\n"
)
theHtml.doPostProcessing()
assert theHtml.theMarkdown[-1] == docText + "\n"
# With Preview, No Revert
# With Preview
theHtml.setPreview(True, True)
theHtml.theText = docText
theHtml.doAutoReplace()
theHtml.doPreProcessing()
theHtml.tokenizeText()
theHtml.doConvert()
assert theHtml.theMarkdown[-1] == (
@@ -456,18 +461,18 @@ def testCoreToHtml_Methods(dummyGUI):
)
# Result Size
assert theHtml.getFullResultSize() == 83
assert theHtml.getFullResultSize() == 147
# CSS
# ===
assert len(theHtml.getStyleSheet()) > 1
assert "p {text-align: left;}" in theHtml.getStyleSheet()
assert "p {text-align: justify;}" not in theHtml.getStyleSheet()
assert "p {text-align: left;" in " ".join(theHtml.getStyleSheet())
assert "p {text-align: justify;" not in " ".join(theHtml.getStyleSheet())
theHtml.setJustify(True)
assert "p {text-align: left;}" not in theHtml.getStyleSheet()
assert "p {text-align: justify;}" in theHtml.getStyleSheet()
assert "p {text-align: left;" not in " ".join(theHtml.getStyleSheet())
assert "p {text-align: justify;" in " ".join(theHtml.getStyleSheet())
theHtml.setStyles(False)
assert theHtml.getStyleSheet() == []
+2 -2
View File
@@ -176,8 +176,8 @@ def testCoreToken_TextOps(monkeypatch, nwMinimal, dummyGUI):
assert theToken.isNote is False
assert theToken.isNovel is True
# Auto replace
theToken.doAutoReplace()
# Pre Processing
theToken.doPreProcessing()
assert theToken.theText == docTextR
# Post Processing
+2
View File
@@ -110,6 +110,8 @@ def testGuiBuild_Tool(qtbot, monkeypatch, nwGUI, nwLipsum, refDir, outDir):
qtbot.wait(stepDelay)
qtbot.mouseClick(nwBuild.includeKeywords, Qt.LeftButton)
qtbot.wait(stepDelay)
qtbot.mouseClick(nwBuild.replaceUCode, Qt.LeftButton)
qtbot.wait(stepDelay)
qtbot.mouseClick(nwBuild.noteFiles, Qt.LeftButton)
qtbot.wait(stepDelay)