Skip to content

Commit

Permalink
Fix tests with int constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
abondar committed May 14, 2024
1 parent 0a97707 commit 452e5d5
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 55 deletions.
66 changes: 33 additions & 33 deletions tests/contrib/test_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_event_schema(self):
"street": {"maxLength": 128, "title": "Street", "type": "string"},
"event_id": {
"maximum": 9223372036854775807,
"minimum": 1,
"minimum": -9223372036854775808,
"title": "Event Id",
"type": "integer",
},
Expand All @@ -88,7 +88,7 @@ def test_event_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -104,7 +104,7 @@ def test_event_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -131,7 +131,7 @@ def test_event_schema(self):
"properties": {
"id": {
"maximum": 32767,
"minimum": 1,
"minimum": -32768,
"title": "Id",
"type": "integer",
},
Expand All @@ -158,7 +158,7 @@ def test_event_schema(self):
"properties": {
"event_id": {
"maximum": 9223372036854775807,
"minimum": 1,
"minimum": -9223372036854775808,
"title": "Event Id",
"type": "integer",
},
Expand Down Expand Up @@ -241,7 +241,7 @@ def test_eventlist_schema(self):
"properties": {
"event_id": {
"maximum": 9223372036854775807,
"minimum": 1,
"minimum": -9223372036854775808,
"title": "Event Id",
"type": "integer",
},
Expand Down Expand Up @@ -325,7 +325,7 @@ def test_eventlist_schema(self):
"street": {"maxLength": 128, "title": "Street", "type": "string"},
"event_id": {
"maximum": 9223372036854775807,
"minimum": 1,
"minimum": -9223372036854775808,
"title": "Event Id",
"type": "integer",
},
Expand All @@ -340,7 +340,7 @@ def test_eventlist_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -356,7 +356,7 @@ def test_eventlist_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -383,7 +383,7 @@ def test_eventlist_schema(self):
"properties": {
"id": {
"maximum": 32767,
"minimum": 1,
"minimum": -32768,
"title": "Id",
"type": "integer",
},
Expand Down Expand Up @@ -423,7 +423,7 @@ def test_address_schema(self):
"properties": {
"event_id": {
"maximum": 9223372036854775807,
"minimum": 1,
"minimum": -9223372036854775808,
"title": "Event Id",
"type": "integer",
},
Expand Down Expand Up @@ -495,7 +495,7 @@ def test_address_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -511,7 +511,7 @@ def test_address_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -538,7 +538,7 @@ def test_address_schema(self):
"properties": {
"id": {
"maximum": 32767,
"minimum": 1,
"minimum": -32768,
"title": "Id",
"type": "integer",
},
Expand Down Expand Up @@ -567,7 +567,7 @@ def test_address_schema(self):
"event": {"$ref": "#/$defs/Event_aajoh6"},
"event_id": {
"maximum": 9223372036854775807,
"minimum": 1,
"minimum": -9223372036854775808,
"title": "Event Id",
"type": "integer",
},
Expand All @@ -589,7 +589,7 @@ def test_tournament_schema(self):
"properties": {
"event_id": {
"maximum": 9223372036854775807,
"minimum": 1,
"minimum": -9223372036854775808,
"title": "Event Id",
"type": "integer",
},
Expand Down Expand Up @@ -664,7 +664,7 @@ def test_tournament_schema(self):
"street": {"maxLength": 128, "title": "Street", "type": "string"},
"event_id": {
"maximum": 9223372036854775807,
"minimum": 1,
"minimum": -9223372036854775808,
"title": "Event Id",
"type": "integer",
},
Expand All @@ -679,7 +679,7 @@ def test_tournament_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -695,7 +695,7 @@ def test_tournament_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -720,7 +720,7 @@ def test_tournament_schema(self):
},
"additionalProperties": False,
"properties": {
"id": {"maximum": 32767, "minimum": 1, "title": "Id", "type": "integer"},
"id": {"maximum": 32767, "minimum": -32768, "title": "Id", "type": "integer"},
"name": {"maxLength": 255, "title": "Name", "type": "string"},
"desc": {
"anyOf": [{"type": "string"}, {"type": "null"}],
Expand Down Expand Up @@ -757,7 +757,7 @@ def test_team_schema(self):
"properties": {
"event_id": {
"maximum": 9223372036854775807,
"minimum": 1,
"minimum": -9223372036854775808,
"title": "Event Id",
"type": "integer",
},
Expand Down Expand Up @@ -833,7 +833,7 @@ def test_team_schema(self):
"street": {"maxLength": 128, "title": "Street", "type": "string"},
"event_id": {
"maximum": 9223372036854775807,
"minimum": 1,
"minimum": -9223372036854775808,
"title": "Event Id",
"type": "integer",
},
Expand All @@ -848,7 +848,7 @@ def test_team_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -863,7 +863,7 @@ def test_team_schema(self):
"properties": {
"id": {
"maximum": 32767,
"minimum": 1,
"minimum": -32768,
"title": "Id",
"type": "integer",
},
Expand All @@ -888,7 +888,7 @@ def test_team_schema(self):
"additionalProperties": False,
"description": "Team that is a playing",
"properties": {
"id": {"maximum": 2147483647, "minimum": 1, "title": "Id", "type": "integer"},
"id": {"maximum": 2147483647, "minimum": -2147483648, "title": "Id", "type": "integer"},
"name": {"title": "Name", "type": "string"},
"alias": {
"anyOf": [
Expand Down Expand Up @@ -1313,7 +1313,7 @@ def test_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -1325,7 +1325,7 @@ def test_schema(self):
},
"manager_id": {
"anyOf": [
{"maximum": 2147483647, "minimum": 1, "type": "integer"},
{"maximum": 2147483647, "minimum": -2147483648, "type": "integer"},
{"type": "null"},
],
"nullable": True,
Expand All @@ -1346,7 +1346,7 @@ def test_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -1358,7 +1358,7 @@ def test_schema(self):
},
"manager_id": {
"anyOf": [
{"maximum": 2147483647, "minimum": 1, "type": "integer"},
{"maximum": 2147483647, "minimum": -2147483648, "type": "integer"},
{"type": "null"},
],
"nullable": True,
Expand All @@ -1379,14 +1379,14 @@ def test_schema(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
"name": {"maxLength": 50, "title": "Name", "type": "string"},
"manager_id": {
"anyOf": [
{"maximum": 2147483647, "minimum": 1, "type": "integer"},
{"maximum": 2147483647, "minimum": -2147483648, "type": "integer"},
{"type": "null"},
],
"nullable": True,
Expand All @@ -1400,7 +1400,7 @@ def test_schema(self):
},
"additionalProperties": False,
"properties": {
"id": {"maximum": 2147483647, "minimum": 1, "title": "Id", "type": "integer"},
"id": {"maximum": 2147483647, "minimum": -2147483648, "title": "Id", "type": "integer"},
"name": {"maxLength": 50, "title": "Name", "type": "string"},
"talks_to": {
"items": {"$ref": "#/$defs/Employee_5gupxf"},
Expand All @@ -1409,7 +1409,7 @@ def test_schema(self):
},
"manager_id": {
"anyOf": [
{"maximum": 2147483647, "minimum": 1, "type": "integer"},
{"maximum": 2147483647, "minimum": -2147483648, "type": "integer"},
{"type": "null"},
],
"nullable": True,
Expand Down
12 changes: 6 additions & 6 deletions tests/test_early_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_early_init(self):
"type": "object",
"description": "The Event model docstring.<br/><br/>This is multiline docs.",
"properties": {
"id": {"title": "Id", "type": "integer", "maximum": 2147483647, "minimum": 1},
"id": {"title": "Id", "type": "integer", "maximum": 2147483647, "minimum": -2147483648},
"name": {
"title": "Name",
"type": "string",
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_early_init(self):
"default": None,
"description": None,
"docstring": None,
"constraints": {"ge": 1, "le": 2147483647},
"constraints": {"ge": -2147483648, "le": 2147483647},
"db_field_types": {"": "INT"},
},
"data_fields": [
Expand Down Expand Up @@ -167,7 +167,7 @@ def test_early_init(self):
"properties": {
"id": {
"maximum": 2147483647,
"minimum": 1,
"minimum": -2147483648,
"title": "Id",
"type": "integer",
},
Expand All @@ -187,7 +187,7 @@ def test_early_init(self):
"additionalProperties": False,
"description": "The Event model docstring.<br/><br/>This is multiline docs.",
"properties": {
"id": {"maximum": 2147483647, "minimum": 1, "title": "Id", "type": "integer"},
"id": {"maximum": 2147483647, "minimum": -2147483648, "title": "Id", "type": "integer"},
"name": {
"description": "The Event NAME<br/>It's pretty important",
"maxLength": 255,
Expand Down Expand Up @@ -235,7 +235,7 @@ def test_early_init(self):
"default": None,
"description": None,
"docstring": None,
"constraints": {"ge": 1, "le": 2147483647},
"constraints": {"ge": -2147483648, "le": 2147483647},
},
"data_fields": [
{
Expand Down Expand Up @@ -289,7 +289,7 @@ def test_early_init(self):
"default": None,
"description": None,
"docstring": None,
"constraints": {"ge": 1, "le": 2147483647},
"constraints": {"ge": -2147483648, "le": 2147483647},
},
],
"fk_fields": [
Expand Down

0 comments on commit 452e5d5

Please sign in to comment.