preparse 2.0.0.dev14__py3-none-any.whl → 2.0.0.dev16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- preparse/__init__.py +1 -2
- preparse/tests/test_expit_toml.py +16 -13
- {preparse-2.0.0.dev14.dist-info → preparse-2.0.0.dev16.dist-info}/METADATA +1 -1
- {preparse-2.0.0.dev14.dist-info → preparse-2.0.0.dev16.dist-info}/RECORD +7 -7
- {preparse-2.0.0.dev14.dist-info → preparse-2.0.0.dev16.dist-info}/WHEEL +0 -0
- {preparse-2.0.0.dev14.dist-info → preparse-2.0.0.dev16.dist-info}/licenses/LICENSE.txt +0 -0
- {preparse-2.0.0.dev14.dist-info → preparse-2.0.0.dev16.dist-info}/top_level.txt +0 -0
preparse/__init__.py
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
from preparse.core import
|
|
2
|
-
from preparse.tests import *
|
|
1
|
+
from preparse.core.PreParser import PreParser
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import enum
|
|
1
2
|
import math
|
|
2
3
|
import tomllib
|
|
3
4
|
import unittest
|
|
5
|
+
from functools import cached_property
|
|
4
6
|
from importlib import resources
|
|
5
7
|
from typing import *
|
|
6
8
|
|
|
@@ -32,14 +34,17 @@ class expit:
|
|
|
32
34
|
click.echo(expit.function(x))
|
|
33
35
|
|
|
34
36
|
|
|
35
|
-
class
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
class Utils(enum.Enum):
|
|
38
|
+
|
|
39
|
+
utils = None
|
|
40
|
+
|
|
41
|
+
@cached_property
|
|
42
|
+
def data(self: Self) -> dict:
|
|
38
43
|
text: str
|
|
39
44
|
text = resources.read_text("preparse.tests", "expit.toml")
|
|
40
|
-
|
|
41
|
-
return data
|
|
45
|
+
return tomllib.loads(text)
|
|
42
46
|
|
|
47
|
+
@staticmethod
|
|
43
48
|
def istestable(x: Any) -> bool:
|
|
44
49
|
if not isinstance(x, float):
|
|
45
50
|
return True
|
|
@@ -67,24 +72,22 @@ class TestMainFunction(unittest.TestCase):
|
|
|
67
72
|
extra = dict()
|
|
68
73
|
extra["cli"] = expit.main
|
|
69
74
|
extra["args"] = query
|
|
70
|
-
if
|
|
75
|
+
if Utils.istestable(prog):
|
|
71
76
|
extra["prog_name"] = prog
|
|
72
77
|
result = runner.invoke(**extra)
|
|
73
|
-
if
|
|
78
|
+
if Utils.istestable(exit_code):
|
|
74
79
|
self.assertEqual(exit_code, result.exit_code)
|
|
75
|
-
if
|
|
80
|
+
if Utils.istestable(output):
|
|
76
81
|
self.assertEqual(output, result.output)
|
|
77
|
-
if
|
|
82
|
+
if Utils.istestable(stdout):
|
|
78
83
|
self.assertEqual(stdout, result.stdout)
|
|
79
|
-
if
|
|
84
|
+
if Utils.istestable(stderr):
|
|
80
85
|
self.assertEqual(stderr, result.stderr)
|
|
81
86
|
|
|
82
87
|
def test_0(self: Self) -> None:
|
|
83
|
-
data: dict
|
|
84
88
|
kwargs: dict
|
|
85
89
|
name: str
|
|
86
|
-
|
|
87
|
-
for name, kwargs in data.items():
|
|
90
|
+
for name, kwargs in Utils.utils.data.items():
|
|
88
91
|
with self.subTest(msg=name, **kwargs):
|
|
89
92
|
self.parse(**kwargs)
|
|
90
93
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
preparse/__init__.py,sha256=
|
|
1
|
+
preparse/__init__.py,sha256=P2Fop7LxsaERhIIRuHZAsTcJ0am7KsBVJB66VD6elt4,46
|
|
2
2
|
preparse/_items/Bundle.py,sha256=14c6zJL6DblOnrIclpI5StgSDGLQD4YeAhSt5cMPwNE,2111
|
|
3
3
|
preparse/_items/Item.py,sha256=mxtp-l83zOjuWESU5NcZz_8g8O-deZ7rV6ndY8cxlC0,749
|
|
4
4
|
preparse/_items/Long.py,sha256=gb8mvgeIo3wIl8n4h-TXp5baEfzwwF5yEw27j5vWL34,1253
|
|
@@ -24,11 +24,11 @@ preparse/tests/data.toml,sha256=nM6CDVt2ayHO9iMd5ux03-BUf7RT48YQ8zBxf8xs94w,1685
|
|
|
24
24
|
preparse/tests/expit.toml,sha256=fP0P99hkbRu2vsCKBFLLCscMPo_XFpMBaV-y0MnjVnw,1206
|
|
25
25
|
preparse/tests/test_data_toml.py,sha256=ZcaZ6i7s8_ddY4mdg7jXwxol0_hSQhy7gdzsLzs_LBE,2460
|
|
26
26
|
preparse/tests/test_enums.py,sha256=MZfmCE-2v_lP6GLqW_b_d5NkN3kUa1lNzQ6JPh26Hmo,383
|
|
27
|
-
preparse/tests/test_expit_toml.py,sha256=
|
|
27
|
+
preparse/tests/test_expit_toml.py,sha256=hr3lcFA7l3P_dp-rEeVVN874r3AVj3mXP8XLsjG-j5Q,2382
|
|
28
28
|
preparse/tests/test_optdict.py,sha256=NuEJp83jsJCq5z0-k6UzT-v4XagT6IgDr45VJZGGKBk,504
|
|
29
29
|
preparse/tests/test_preparser.py,sha256=imEv-Yfh7FI6H-zKo3hvyBJWvMUWUDxWCTvfHB4nnVI,1271
|
|
30
|
-
preparse-2.0.0.
|
|
31
|
-
preparse-2.0.0.
|
|
32
|
-
preparse-2.0.0.
|
|
33
|
-
preparse-2.0.0.
|
|
34
|
-
preparse-2.0.0.
|
|
30
|
+
preparse-2.0.0.dev16.dist-info/licenses/LICENSE.txt,sha256=QwqYepQwTN5xG57cngKt6xxYD9z9hw9d3lcI8zSLiNg,1074
|
|
31
|
+
preparse-2.0.0.dev16.dist-info/METADATA,sha256=WuI6nlbFJ5xr_W0JbB51IlJkps4CRxMLJAQpu3qkYqo,2603
|
|
32
|
+
preparse-2.0.0.dev16.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
33
|
+
preparse-2.0.0.dev16.dist-info/top_level.txt,sha256=YFPuigMoI1m1K63OFDAQ6zN8yqCwAFwC7lNCTIOKj1I,9
|
|
34
|
+
preparse-2.0.0.dev16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|