diff options
| author | Michael Milton <ttmigueltt@gmail.com> | 2020-06-03 20:18:08 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-03 05:18:08 -0500 |
| commit | 22940c8f44162641ff4000a463f99134a28a9a5a (patch) | |
| tree | 040284584072ad988c153f5331f131e0b3e17af2 /tests | |
| parent | 58c171bb5077f615dc36fc55f470a462e56da891 (diff) | |
| download | pyparsing-git-22940c8f44162641ff4000a463f99134a28a9a5a.tar.gz | |
Railroad Diagram Improvements (#220)
* Add diagram documentation, add more diagram tests, allow more
customization of diagrams
* Remove accidental edit of unrelated documentation
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_diagram.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_diagram.py b/tests/test_diagram.py index 843228b..a449bb0 100644 --- a/tests/test_diagram.py +++ b/tests/test_diagram.py @@ -1,6 +1,8 @@ import unittest from examples.jsonParser import jsonObject from examples.simpleBool import boolExpr +from examples.simpleSQL import simpleSQL +from examples.mozillaCalendarParser import calendars from pyparsing.diagram import to_railroad, railroad_to_html import tempfile import os @@ -36,3 +38,19 @@ class TestRailroadDiagrams(unittest.TestCase): if self.railroad_debug(): print(temp.name) + + def test_sql(self): + with self.get_temp() as temp: + railroad = to_railroad(simpleSQL) + temp.write(railroad_to_html(railroad)) + + if self.railroad_debug(): + print(temp.name) + + def test_calendars(self): + with self.get_temp() as temp: + railroad = to_railroad(calendars) + temp.write(railroad_to_html(railroad)) + + if self.railroad_debug(): + print(temp.name) |
