punit 0.0.28__tar.gz → 0.1.0__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.
- {punit-0.0.28 → punit-0.1.0}/PKG-INFO +1 -1
- {punit-0.0.28 → punit-0.1.0}/punit/__init__.py +1 -1
- {punit-0.0.28 → punit-0.1.0}/punit/assertions/__init__.py +2 -1
- punit-0.1.0/punit/assertions/collections.py +61 -0
- punit-0.1.0/punit/assertions/strings.py +56 -0
- {punit-0.0.28 → punit-0.1.0}/punit.egg-info/PKG-INFO +1 -1
- {punit-0.0.28 → punit-0.1.0}/punit.egg-info/SOURCES.txt +1 -0
- {punit-0.0.28 → punit-0.1.0}/pyproject.toml +1 -1
- punit-0.0.28/punit/assertions/collections.py +0 -18
- {punit-0.0.28 → punit-0.1.0}/LICENSE +0 -0
- {punit-0.0.28 → punit-0.1.0}/README.md +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/TestResult.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/__main__.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/assertions/exceptions.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/cli.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/discovery/TestModuleDiscovery.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/discovery/__init__.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/facts/Fact.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/facts/FactManager.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/facts/__init__.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/reports/HtmlReportGenerator.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/reports/JUnitReportGenerator.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/reports/__init__.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/runner.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/theories/Theory.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/theories/TheoryManager.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit/theories/__init__.py +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit.egg-info/dependency_links.txt +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit.egg-info/entry_points.txt +0 -0
- {punit-0.0.28 → punit-0.1.0}/punit.egg-info/top_level.txt +0 -0
- {punit-0.0.28 → punit-0.1.0}/setup.cfg +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2024 Shaun Wilson
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
from typing import Any, Sequence
|
|
5
|
+
|
|
6
|
+
def areSame(a:Sequence[Any]|None, b:Sequence[Any]|None) -> bool:
|
|
7
|
+
"""
|
|
8
|
+
Check if two sequences contain the same elements in the same order.
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
a: The sequence to check
|
|
12
|
+
b: The sequence to compare against
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
True if the sequences contain the same elements in the same order, False otherwise
|
|
16
|
+
"""
|
|
17
|
+
if a is b:
|
|
18
|
+
return True
|
|
19
|
+
elif a is None and b is not None:
|
|
20
|
+
return False
|
|
21
|
+
elif a is not None and b is None:
|
|
22
|
+
return False
|
|
23
|
+
elif len(a) != len(b):
|
|
24
|
+
return False
|
|
25
|
+
for i in range(len(a)):
|
|
26
|
+
if not a[i] == b[i]:
|
|
27
|
+
return False
|
|
28
|
+
return True
|
|
29
|
+
|
|
30
|
+
def hasLength(sequence:Sequence[Any]|None, expected:int|None) -> bool:
|
|
31
|
+
"""
|
|
32
|
+
Check if a sequence has the expected number of elements.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
sequence: The sequence to check
|
|
36
|
+
expected: The expected number of elements
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
True if the sequence has exactly the expected number of elements, False otherwise
|
|
40
|
+
"""
|
|
41
|
+
if sequence is None and (expected is None or expected == 0):
|
|
42
|
+
return True
|
|
43
|
+
elif sequence is None and (expected is not None and expected != 0):
|
|
44
|
+
return False
|
|
45
|
+
elif sequence is not None and expected is None:
|
|
46
|
+
return False
|
|
47
|
+
return len(sequence) == expected
|
|
48
|
+
|
|
49
|
+
def isNoneOrEmpty(sequence:Sequence[Any]|None) -> bool:
|
|
50
|
+
"""
|
|
51
|
+
Check if a sequence is None or empty.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
sequence: The sequence to check
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
True if the sequence is None or empty, False otherwise
|
|
58
|
+
"""
|
|
59
|
+
if sequence is None:
|
|
60
|
+
return True
|
|
61
|
+
return len(sequence) == 0
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2024 Shaun Wilson
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
def areSame(a:str|None, b:str|None) -> bool:
|
|
7
|
+
"""
|
|
8
|
+
Check if two strings contain the same characters in the same order.
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
a: The first string
|
|
12
|
+
b: The second string
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
True if the strings contain the same characters in the same order, False otherwise
|
|
16
|
+
"""
|
|
17
|
+
if a is b:
|
|
18
|
+
return True
|
|
19
|
+
elif a is None and b is not None:
|
|
20
|
+
return False
|
|
21
|
+
elif a is not None and b is None:
|
|
22
|
+
return False
|
|
23
|
+
elif len(a) != len(b):
|
|
24
|
+
return False
|
|
25
|
+
for i in range(len(a)):
|
|
26
|
+
if a[i] != b[i]:
|
|
27
|
+
return False
|
|
28
|
+
return True
|
|
29
|
+
|
|
30
|
+
def isNoneOrEmpty(string:str|None) -> bool:
|
|
31
|
+
"""
|
|
32
|
+
Check if a string is None or empty.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
string: The string to check
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
True if the string is None or empty, False otherwise
|
|
39
|
+
"""
|
|
40
|
+
if string is None:
|
|
41
|
+
return True
|
|
42
|
+
return len(string) == 0
|
|
43
|
+
|
|
44
|
+
def isNoneOrWhitespace(string:str|None) -> bool:
|
|
45
|
+
"""
|
|
46
|
+
Check if a string is None or whitespace.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
string: The string to check
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
True if the string is None or whitespace, False otherwise
|
|
53
|
+
"""
|
|
54
|
+
if string is None:
|
|
55
|
+
return True
|
|
56
|
+
return len(string.strip()) == 0
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: © 2024 Shaun Wilson
|
|
2
|
-
# SPDX-License-Identifier: MIT
|
|
3
|
-
|
|
4
|
-
from typing import Any, Sequence
|
|
5
|
-
|
|
6
|
-
def areSame(a:Sequence[Any], b:Sequence[Any]) -> bool:
|
|
7
|
-
if a is b:
|
|
8
|
-
return True
|
|
9
|
-
elif a is None and b is not None:
|
|
10
|
-
return False
|
|
11
|
-
elif a is not None and b is None:
|
|
12
|
-
return False
|
|
13
|
-
elif len(a) != len(b):
|
|
14
|
-
return False
|
|
15
|
-
for i in range(len(a)):
|
|
16
|
-
if not a[i] == b[i]:
|
|
17
|
-
return False
|
|
18
|
-
return True
|
|
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
|
|
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
|