datarepr 1.2.7__tar.gz → 1.2.8__tar.gz
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.
- datarepr-1.2.8/MANIFEST.in +3 -0
- {datarepr-1.2.7/src/datarepr.egg-info → datarepr-1.2.8}/PKG-INFO +1 -1
- {datarepr-1.2.7 → datarepr-1.2.8}/pyproject.toml +1 -1
- {datarepr-1.2.7 → datarepr-1.2.8}/src/datarepr/__init__.py +1 -1
- {datarepr-1.2.7 → datarepr-1.2.8}/src/datarepr/core.py +1 -1
- {datarepr-1.2.7 → datarepr-1.2.8}/src/datarepr/tests/__init__.py +1 -1
- {datarepr-1.2.7 → datarepr-1.2.8}/src/datarepr/tests/test_0.py +12 -10
- {datarepr-1.2.7 → datarepr-1.2.8}/src/datarepr/tests/test_oxford.py +2 -2
- {datarepr-1.2.7 → datarepr-1.2.8/src/datarepr.egg-info}/PKG-INFO +1 -1
- datarepr-1.2.7/MANIFEST.in +0 -2
- {datarepr-1.2.7 → datarepr-1.2.8}/LICENSE.txt +0 -0
- {datarepr-1.2.7 → datarepr-1.2.8}/README.rst +0 -0
- {datarepr-1.2.7 → datarepr-1.2.8}/docs/v1.0.rst +0 -0
- {datarepr-1.2.7 → datarepr-1.2.8}/docs/v1.1.rst +0 -0
- {datarepr-1.2.7 → datarepr-1.2.8}/docs/v1.2.rst +0 -0
- {datarepr-1.2.7 → datarepr-1.2.8}/setup.cfg +0 -0
- {datarepr-1.2.7 → datarepr-1.2.8}/src/datarepr/py.typed +0 -0
- {datarepr-1.2.7 → datarepr-1.2.8}/src/datarepr/tests/testdata.toml +0 -0
- {datarepr-1.2.7 → datarepr-1.2.8}/src/datarepr.egg-info/SOURCES.txt +0 -0
- {datarepr-1.2.7 → datarepr-1.2.8}/src/datarepr.egg-info/dependency_links.txt +0 -0
- {datarepr-1.2.7 → datarepr-1.2.8}/src/datarepr.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Test the datarepr function."""
|
|
2
2
|
|
|
3
|
-
__all__ = ["TestDatareprFunction"]
|
|
3
|
+
__all__: list[str] = ["TestDatareprFunction"]
|
|
4
4
|
|
|
5
5
|
import enum
|
|
6
6
|
import io
|
|
@@ -18,7 +18,7 @@ class Lazy(enum.Enum):
|
|
|
18
18
|
lazy = None
|
|
19
19
|
|
|
20
20
|
@cached_property
|
|
21
|
-
def data(self: Self) -> dict[str, Any]:
|
|
21
|
+
def data(self: Self, /) -> dict[str, Any]:
|
|
22
22
|
file: Path
|
|
23
23
|
stream: io.BufferedReader
|
|
24
24
|
file = Path(__file__).parent / "testdata.toml"
|
|
@@ -26,7 +26,7 @@ class Lazy(enum.Enum):
|
|
|
26
26
|
return tomllib.load(stream)
|
|
27
27
|
|
|
28
28
|
@cached_property
|
|
29
|
-
def test_0(self: Self) -> dict[str, Any]:
|
|
29
|
+
def test_0(self: Self, /) -> dict[str, Any]:
|
|
30
30
|
return cast(dict[str, Any], self.lazy.data["test_0"])
|
|
31
31
|
|
|
32
32
|
|
|
@@ -38,9 +38,9 @@ class TestDatareprFunction(unittest.TestCase):
|
|
|
38
38
|
name: str,
|
|
39
39
|
/,
|
|
40
40
|
*,
|
|
41
|
-
solution: str,
|
|
42
41
|
args: Sequence[Any],
|
|
43
42
|
kwargs: Any = (),
|
|
43
|
+
solution: str,
|
|
44
44
|
) -> None:
|
|
45
45
|
"""Test the datarepr function with valid parameters."""
|
|
46
46
|
result: str
|
|
@@ -48,12 +48,14 @@ class TestDatareprFunction(unittest.TestCase):
|
|
|
48
48
|
result = datarepr(*args, **dict(kwargs))
|
|
49
49
|
self.assertEqual(result, solution)
|
|
50
50
|
|
|
51
|
-
def test_0(self: Self) -> None:
|
|
51
|
+
def test_0(self: Self, /) -> None:
|
|
52
52
|
"""Test the testdata."""
|
|
53
|
+
x: Any
|
|
54
|
+
y: Any
|
|
53
55
|
for x, y in Lazy.lazy.test_0.items():
|
|
54
56
|
self.go_valid(x, **y)
|
|
55
57
|
|
|
56
|
-
def test_combination_of_all(self: Self) -> None:
|
|
58
|
+
def test_combination_of_all(self: Self, /) -> None:
|
|
57
59
|
"""Test a complex combination of types and structures."""
|
|
58
60
|
result: str
|
|
59
61
|
solution: str
|
|
@@ -71,13 +73,13 @@ class TestDatareprFunction(unittest.TestCase):
|
|
|
71
73
|
)
|
|
72
74
|
self.assertEqual(result, solution)
|
|
73
75
|
|
|
74
|
-
def test_name_as_non_string(self: Self) -> None:
|
|
76
|
+
def test_name_as_non_string(self: Self, /) -> None:
|
|
75
77
|
"""Test with the 'name' parameter as a non-string type."""
|
|
76
78
|
result: str
|
|
77
79
|
result = datarepr(None, "arg1")
|
|
78
80
|
self.assertEqual(result, "None('arg1')")
|
|
79
81
|
|
|
80
|
-
def test_no_args_at_all(self: Self) -> None:
|
|
82
|
+
def test_no_args_at_all(self: Self, /) -> None:
|
|
81
83
|
"""Test with no arguments, not even the name."""
|
|
82
84
|
args: Any
|
|
83
85
|
args = ()
|
|
@@ -85,7 +87,7 @@ class TestDatareprFunction(unittest.TestCase):
|
|
|
85
87
|
# Raise TypeError: missing required 'name' argument.
|
|
86
88
|
datarepr(*args)
|
|
87
89
|
|
|
88
|
-
def test_special_characters(self: Self) -> None:
|
|
90
|
+
def test_special_characters(self: Self, /) -> None:
|
|
89
91
|
"""Test with special characters in arguments."""
|
|
90
92
|
result: str
|
|
91
93
|
result = datarepr("test_function", "a\nb", "\t", key="val\nue")
|
|
@@ -93,7 +95,7 @@ class TestDatareprFunction(unittest.TestCase):
|
|
|
93
95
|
result, "test_function('a\\nb', '\\t', key='val\\nue')"
|
|
94
96
|
)
|
|
95
97
|
|
|
96
|
-
def test_various_types(self: Self) -> None:
|
|
98
|
+
def test_various_types(self: Self, /) -> None:
|
|
97
99
|
"""Test with various types of arguments."""
|
|
98
100
|
result: str
|
|
99
101
|
result = datarepr("test_function", 1, 2.0, True, None)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Test the oxford function."""
|
|
2
2
|
|
|
3
|
-
__all__ = ["TestOxfordFunction"]
|
|
3
|
+
__all__: list[str] = ["TestOxfordFunction"]
|
|
4
4
|
|
|
5
5
|
import unittest
|
|
6
6
|
from typing import Self
|
|
@@ -11,7 +11,7 @@ from datarepr.core import oxford
|
|
|
11
11
|
class TestOxfordFunction(unittest.TestCase):
|
|
12
12
|
"""Test the oxford function comprehensively."""
|
|
13
13
|
|
|
14
|
-
def test_no_args_at_all(self: Self) -> None:
|
|
14
|
+
def test_no_args_at_all(self: Self, /) -> None:
|
|
15
15
|
"""Test oxford with varying numbers of arguments."""
|
|
16
16
|
self.assertEqual("", oxford())
|
|
17
17
|
self.assertEqual(42, oxford(default=42))
|
datarepr-1.2.7/MANIFEST.in
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|