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.
Files changed (31) hide show
  1. {punit-0.0.28 → punit-0.1.0}/PKG-INFO +1 -1
  2. {punit-0.0.28 → punit-0.1.0}/punit/__init__.py +1 -1
  3. {punit-0.0.28 → punit-0.1.0}/punit/assertions/__init__.py +2 -1
  4. punit-0.1.0/punit/assertions/collections.py +61 -0
  5. punit-0.1.0/punit/assertions/strings.py +56 -0
  6. {punit-0.0.28 → punit-0.1.0}/punit.egg-info/PKG-INFO +1 -1
  7. {punit-0.0.28 → punit-0.1.0}/punit.egg-info/SOURCES.txt +1 -0
  8. {punit-0.0.28 → punit-0.1.0}/pyproject.toml +1 -1
  9. punit-0.0.28/punit/assertions/collections.py +0 -18
  10. {punit-0.0.28 → punit-0.1.0}/LICENSE +0 -0
  11. {punit-0.0.28 → punit-0.1.0}/README.md +0 -0
  12. {punit-0.0.28 → punit-0.1.0}/punit/TestResult.py +0 -0
  13. {punit-0.0.28 → punit-0.1.0}/punit/__main__.py +0 -0
  14. {punit-0.0.28 → punit-0.1.0}/punit/assertions/exceptions.py +0 -0
  15. {punit-0.0.28 → punit-0.1.0}/punit/cli.py +0 -0
  16. {punit-0.0.28 → punit-0.1.0}/punit/discovery/TestModuleDiscovery.py +0 -0
  17. {punit-0.0.28 → punit-0.1.0}/punit/discovery/__init__.py +0 -0
  18. {punit-0.0.28 → punit-0.1.0}/punit/facts/Fact.py +0 -0
  19. {punit-0.0.28 → punit-0.1.0}/punit/facts/FactManager.py +0 -0
  20. {punit-0.0.28 → punit-0.1.0}/punit/facts/__init__.py +0 -0
  21. {punit-0.0.28 → punit-0.1.0}/punit/reports/HtmlReportGenerator.py +0 -0
  22. {punit-0.0.28 → punit-0.1.0}/punit/reports/JUnitReportGenerator.py +0 -0
  23. {punit-0.0.28 → punit-0.1.0}/punit/reports/__init__.py +0 -0
  24. {punit-0.0.28 → punit-0.1.0}/punit/runner.py +0 -0
  25. {punit-0.0.28 → punit-0.1.0}/punit/theories/Theory.py +0 -0
  26. {punit-0.0.28 → punit-0.1.0}/punit/theories/TheoryManager.py +0 -0
  27. {punit-0.0.28 → punit-0.1.0}/punit/theories/__init__.py +0 -0
  28. {punit-0.0.28 → punit-0.1.0}/punit.egg-info/dependency_links.txt +0 -0
  29. {punit-0.0.28 → punit-0.1.0}/punit.egg-info/entry_points.txt +0 -0
  30. {punit-0.0.28 → punit-0.1.0}/punit.egg-info/top_level.txt +0 -0
  31. {punit-0.0.28 → punit-0.1.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: punit
3
- Version: 0.0.28
3
+ Version: 0.1.0
4
4
  Summary: A modernized unit-test framework for Python.
5
5
  Author-email: Shaun Wilson <mrshaunwilson@msn.com>
6
6
  Project-URL: Documentation, https://punit.readthedocs.io/
@@ -1,7 +1,7 @@
1
1
  # SPDX-FileCopyrightText: © 2024 Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
- __version__ = '0.0.28'
4
+ __version__ = '0.1.0'
5
5
 
6
6
  from .assertions import *
7
7
  from .facts import *
@@ -3,5 +3,6 @@
3
3
 
4
4
  __all__ = [
5
5
  'collections',
6
- 'exceptions'
6
+ 'exceptions',
7
+ 'strings'
7
8
  ]
@@ -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,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: punit
3
- Version: 0.0.28
3
+ Version: 0.1.0
4
4
  Summary: A modernized unit-test framework for Python.
5
5
  Author-email: Shaun Wilson <mrshaunwilson@msn.com>
6
6
  Project-URL: Documentation, https://punit.readthedocs.io/
@@ -14,6 +14,7 @@ punit.egg-info/top_level.txt
14
14
  punit/assertions/__init__.py
15
15
  punit/assertions/collections.py
16
16
  punit/assertions/exceptions.py
17
+ punit/assertions/strings.py
17
18
  punit/discovery/TestModuleDiscovery.py
18
19
  punit/discovery/__init__.py
19
20
  punit/facts/Fact.py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "punit"
3
- version = "0.0.28"
3
+ version = "0.1.0"
4
4
  description = "A modernized unit-test framework for Python."
5
5
  keywords = ["test", "unittest", "unit-test"]
6
6
  authors = [
@@ -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