DataComparerLibrary 0.851__tar.gz → 0.854__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 (22) hide show
  1. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/PKG-INFO +1 -1
  2. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/pyproject.toml +1 -1
  3. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/field.py +23 -22
  4. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary.egg-info/PKG-INFO +1 -1
  5. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/LICENSE.txt +0 -0
  6. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/README.rst +0 -0
  7. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/setup.cfg +0 -0
  8. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/__init__.py +0 -0
  9. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/datacomparer.py +0 -0
  10. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/datasorter.py +0 -0
  11. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/datetimehandler.py +0 -0
  12. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/delimitertranslator.py +0 -0
  13. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/fileconverter.py +0 -0
  14. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/matchstatus.py +0 -0
  15. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/report.py +0 -0
  16. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/row.py +0 -0
  17. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/tools.py +0 -0
  18. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary/twodarray.py +0 -0
  19. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary.egg-info/SOURCES.txt +0 -0
  20. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary.egg-info/dependency_links.txt +0 -0
  21. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary.egg-info/requires.txt +0 -0
  22. {datacomparerlibrary-0.851 → datacomparerlibrary-0.854}/src/DataComparerLibrary.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: DataComparerLibrary
3
- Version: 0.851
3
+ Version: 0.854
4
4
  Summary: For comparing csv-files, 2d-array with a csv-file or 2d-arrays. For comparing text-files, text variable with a text-file or text variables. Including a sorting module.
5
5
  Author-email: René Philip Zuijderduijn <datacomparerlibrary@outlook.com>
6
6
  License-Expression: Apache-2.0
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
  [project]
7
7
  name = "DataComparerLibrary"
8
8
  description = "For comparing csv-files, 2d-array with a csv-file or 2d-arrays. For comparing text-files, text variable with a text-file or text variables. Including a sorting module."
9
- version = "0.851"
9
+ version = "0.854"
10
10
  dependencies = ["python-dateutil"]
11
11
  authors = [{ name = "René Philip Zuijderduijn", email = "datacomparerlibrary@outlook.com" }]
12
12
  readme = "README.rst"
@@ -66,30 +66,36 @@ class Field:
66
66
 
67
67
 
68
68
  def __match_data_with_template_keyword(self, other_field_data_including_templates):
69
- match_status = MatchStatus.MISMATCH
69
+ match_status = MatchStatus.MATCH
70
70
  #
71
71
  match other_field_data_including_templates.upper():
72
72
  case "{PRESENT}":
73
- if self.field_data:
74
- match_status = MatchStatus.MATCH
75
- else:
73
+ if not self.field_data:
76
74
  # No data is present in actual data field.
75
+ match_status = MatchStatus.MISMATCH
77
76
  Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, "Actual data field is not PRESENT")
78
77
  #
79
78
  case "{EMPTY}":
80
- if not self.field_data:
81
- match_status = MatchStatus.MATCH
82
- else:
79
+ if self.field_data:
83
80
  # Actual data field is not empty.
81
+ match_status = MatchStatus.MISMATCH
84
82
  Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, "Actual data field is not EMPTY")
85
83
  #
86
84
  case "{INTEGER}":
87
85
  if isinstance(self.field_data, int):
88
86
  # A real integer (positive or negative).
89
87
  match_status = MatchStatus.MATCH
88
+ #
89
+ elif self.field_data.isdigit():
90
+ # Test on INTEGER temporary less tide again
91
+ # Positive integer field in string format.
92
+ match_status = MatchStatus.MATCH
93
+ # Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, "There is a difference between actual and expected data. Actual data is an INTEGER in string format while an INTEGER is expected.")
90
94
  elif isinstance(self.field_data, str):
95
+ match_status = MatchStatus.MISMATCH
91
96
  Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, "There is a difference between actual and expected data. Actual data is a string while an INTEGER is expected.")
92
97
  else:
98
+ match_status = MatchStatus.MISMATCH
93
99
  Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, "There is a difference between actual and expected data. Actual data field is not INTEGER.")
94
100
  #
95
101
  case "{SKIP}":
@@ -109,21 +115,16 @@ class Field:
109
115
  skip_exception_rule_used = False
110
116
 
111
117
  if "{SKIP}" in other_field_data_including_templates.upper() or "{DATETIME_FORMAT():YYYYMMDDHHMMSSFF6}" in other_field_data_including_templates.upper():
112
- if other_field_data_including_templates.upper() == "{SKIP}":
113
- # Complete actual data field will be skipped for verification.
114
- pass
115
- else:
116
- # Part(s) of the actual data field will be skipped for verification.
117
- # Replace {SKIP}, ignoring cases, by wildcard *.
118
- # compiled = re.compile(re.escape("{SKIP}"), re.IGNORECASE)
119
- # expected_data_with_wildcard = compiled.sub("*", other_field_data_including_templates)
120
- compiled = re.compile(re.escape("{SKIP}"), re.IGNORECASE)
121
- compiled2 = re.compile(re.escape("{DATETIME_FORMAT():YYYYMMDDHHMMSSFF6}"), re.IGNORECASE)
122
- expected_data_with_wildcard = compiled2.sub("*", compiled.sub("*", other_field_data_including_templates))
123
- #
124
- if fnmatch.fnmatch(self.field_data, expected_data_with_wildcard):
125
- skip_exception_rule_used = True
126
- # continue
118
+ # Part(s) of the actual data field will be skipped for verification.
119
+ # Replace {SKIP}, ignoring cases, by wildcard *.
120
+ # compiled = re.compile(re.escape("{SKIP}"), re.IGNORECASE)
121
+ # expected_data_with_wildcard = compiled.sub("*", other_field_data_including_templates)
122
+ compiled = re.compile(re.escape("{SKIP}"), re.IGNORECASE)
123
+ compiled2 = re.compile(re.escape("{DATETIME_FORMAT():YYYYMMDDHHMMSSFF6}"), re.IGNORECASE)
124
+ expected_data_with_wildcard = compiled2.sub("*", compiled.sub("*", other_field_data_including_templates))
125
+ #
126
+ if fnmatch.fnmatch(self.field_data, expected_data_with_wildcard):
127
+ skip_exception_rule_used = True
127
128
  #
128
129
  if expected_data_with_wildcard == None:
129
130
  # Wildcards not used.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: DataComparerLibrary
3
- Version: 0.851
3
+ Version: 0.854
4
4
  Summary: For comparing csv-files, 2d-array with a csv-file or 2d-arrays. For comparing text-files, text variable with a text-file or text variables. Including a sorting module.
5
5
  Author-email: René Philip Zuijderduijn <datacomparerlibrary@outlook.com>
6
6
  License-Expression: Apache-2.0