File: test_examples.py

package info (click to toggle)
pyparsing 3.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,200 kB
  • sloc: python: 30,867; ansic: 422; sh: 112; makefile: 24
file content (74 lines) | stat: -rw-r--r-- 1,699 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# test_examples.py
#
from importlib import import_module
import unittest

from pyparsing import testing as ppt


class TestExamples(unittest.TestCase):
    def _run(self, name):
        mod = import_module("examples." + name)

        # use pyparsing context to reset each test to clean
        # pyparsing settings
        with ppt.reset_pyparsing_context():
            getattr(mod, "main", lambda *args, **kwargs: None)()

    def test_numerics(self):
        self._run("numerics")

    def test_parse_python_value(self):
        self._run("parse_python_value")

    def test_tap(self):
        self._run("TAP")

    def test_roman_numerals(self):
        self._run("roman_numerals")

    def test_sexp_parser(self):
        self._run("sexpParser")

    def test_oc(self):
        self._run("oc")

    def test_delta_time(self):
        self._run("delta_time")

    def test_eval_arith(self):
        self._run("eval_arith")

    def test_select_parser(self):
        self._run("select_parser")

    def test_booleansearchparser(self):
        self._run("booleansearchparser")

    def test_rosettacode(self):
        self._run("rosettacode")

    def test_excelExpr(self):
        self._run("excel_expr")

    def test_lucene_grammar(self):
        self._run("lucene_grammar")

    def test_range_check(self):
        self._run("range_check")

    def test_stackish(self):
        self._run("stackish")

    def test_email_parser(self):
        self._run("email_address_parser")

    def test_mongodb_query_parser(self):
        self._run("mongodb_query_expression")

    def test_lox_parser(self):
        self._run("lox_parser")

    def test_inv_regex(self):
        self._run("inv_regex")