sefrone-api-e2e 1.0.4__tar.gz → 1.0.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sefrone_api_e2e
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: A Python package to provide e2e testing helpers for sefrone API projects
5
5
  Home-page: https://bitbucket.org/sefrone/sefrone_pypi
6
6
  Author: Sefrone
@@ -129,15 +129,24 @@ class ApiE2ETestsManager:
129
129
 
130
130
  @staticmethod
131
131
  def check_type(value, expected_type):
132
+ # Check for nullable type (e.g., "string?", "number?")
133
+ is_nullable = expected_type.endswith("?")
134
+ if is_nullable:
135
+ base_type = expected_type[:-1]
136
+ if value is None:
137
+ return True
138
+ else:
139
+ base_type = expected_type
140
+
132
141
  type_map = {
133
142
  "string": str,
134
143
  "number": (int, float),
135
144
  "boolean": bool,
136
145
  "datetime": str
137
146
  }
138
- if expected_type not in type_map:
147
+ if base_type not in type_map:
139
148
  raise ValueError(f"Unknown type in YAML: {expected_type}")
140
- if expected_type == "datetime":
149
+ if base_type == "datetime":
141
150
  try:
142
151
  datetime.datetime.fromisoformat(value)
143
152
  return True
@@ -148,7 +157,7 @@ class ApiE2ETestsManager:
148
157
  return True
149
158
  except Exception:
150
159
  return False
151
- return isinstance(value, type_map[expected_type])
160
+ return isinstance(value, type_map[base_type])
152
161
 
153
162
  @staticmethod
154
163
  def validate_structure(data, expected):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sefrone-api-e2e
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: A Python package to provide e2e testing helpers for sefrone API projects
5
5
  Home-page: https://bitbucket.org/sefrone/sefrone_pypi
6
6
  Author: Sefrone
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="sefrone_api_e2e",
8
- version="1.0.4",
8
+ version="1.0.5",
9
9
  author="Sefrone",
10
10
  author_email="contact@sefrone.com",
11
11
  description="A Python package to provide e2e testing helpers for sefrone API projects",