Skip to content

Commit

Permalink
update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed Mar 9, 2024
1 parent fb3a1d6 commit f7046f6
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class ObjProperty:
def __init__(self, input):
if hasattr(input, 'number'):
self._number = input.number
if hasattr(input, 'additionalProperties'):
self._additional_properties = input.additionalProperties
if hasattr(input, 'additional_properties'):
self._additional_properties = input.additional_properties
@property
def number(self):
Expand All @@ -20,10 +20,10 @@ class ObjProperty:
@property
def additional_properties(self):
return self._additional_properties
return self._additional_properties
@additional_properties.setter
def additional_properties(self, additional_properties):
self._additional_properties = additional_properties
self._additional_properties = additional_properties
",
]
`;
Expand All @@ -35,9 +35,9 @@ Array [
class ObjProperty:
def __init__(self, input):
if hasattr(input, 'number'):
self._number = input.number
self._number = input.number
if hasattr(input, 'additional_properties'):
self._additional_properties = input.additional_properties
self._additional_properties = input.additional_properties
@property
def number(self):
Expand All @@ -48,10 +48,10 @@ class ObjProperty:
@property
def additional_properties(self):
return self._additional_properties
return self._additional_properties
@additional_properties.setter
def additional_properties(self, additional_properties):
self._additional_properties = additional_properties
self._additional_properties = additional_properties
",
]
`;
Expand All @@ -63,9 +63,9 @@ Array [
class Root:
def __init__(self, input):
if hasattr(input, 'email'):
self._email = input.email
self._email = input.email
if hasattr(input, 'obj_property'):
self._obj_property = input.obj_property
self._obj_property = input.obj_property
@property
def email(self):
Expand All @@ -76,10 +76,10 @@ class Root:
@property
def obj_property(self):
return self._obj_property
return self._obj_property
@obj_property.setter
def obj_property(self, obj_property):
self._obj_property = obj_property
self._obj_property = obj_property
",
]
`;
Expand All @@ -91,9 +91,9 @@ Array [
class Root:
def __init__(self, input):
if hasattr(input, 'email'):
self._email = input.email
self._email = input.email
if hasattr(input, 'obj_property'):
self._obj_property = input.obj_property
self._obj_property = input.obj_property
@property
def email(self):
Expand All @@ -104,10 +104,10 @@ class Root:
@property
def obj_property(self):
return self._obj_property
return self._obj_property
@obj_property.setter
def obj_property(self, obj_property):
self._obj_property = obj_property
self._obj_property = obj_property
",
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Array [
"class Root:
def __init__(self, input):
if hasattr(input, 'email'):
self._email = input.email
self._email = input.email
if hasattr(input, 'additional_properties'):
self._additional_properties = input.additional_properties
self._additional_properties = input.additional_properties
@property
def email(self):
Expand All @@ -18,10 +18,10 @@ Array [
@property
def additional_properties(self):
return self._additional_properties
return self._additional_properties
@additional_properties.setter
def additional_properties(self, additional_properties):
self._additional_properties = additional_properties
self._additional_properties = additional_properties
def serialize_to_json(self):
return json.dumps(self.__dict__, default=lambda o: o.__dict__, indent=2)
Expand Down
50 changes: 33 additions & 17 deletions test/generators/python/__snapshots__/PythonGenerator.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ exports[`PythonGenerator Class should not render reserved keyword 1`] = `
"class Address:
def __init__(self, input):
if hasattr(input, 'reserved_del'):
self._reserved_del = input.reserved_del
self._reserved_del = input.reserved_del
@property
def reserved_del(self):
return self._reserved_del
return self._reserved_del
@reserved_del.setter
def reserved_del(self, reserved_del):
self._reserved_del = reserved_del
self._reserved_del = reserved_del
"
`;

Expand All @@ -25,22 +25,38 @@ exports[`PythonGenerator Class should render \`class\` type 1`] = `
if hasattr(input, 'marriage'):
self._marriage = input.marriage
if hasattr(input, 'members'):
self._members = input.members
self._members = input.members
self._array_type = input.array_type
if hasattr(input, 'additional_properties'):
self._additional_properties = input.additional_properties
self._additional_properties = input.additional_properties
@property
def street_name(self):
return self._street_name
return self._street_name
@street_name.setter
def street_name(self, street_name):
self._street_name = street_name
self._street_name = street_name
@property
def city(self):
return self._city
@city.setter
def city(self, city):
self._city = city
@property
def state(self):
return self._state
@state.setter
def state(self, state):
self._state = state
@property
def house_number(self):
return self._house_number
return self._house_number
@house_number.setter
def house_number(self, house_number):
self._house_number = house_number
self._house_number = house_number
@property
def marriage(self):
Expand All @@ -58,17 +74,17 @@ exports[`PythonGenerator Class should render \`class\` type 1`] = `
@property
def array_type(self):
return self._array_type
return self._array_type
@array_type.setter
def array_type(self, array_type):
self._array_type = array_type
self._array_type = array_type
@property
def additional_properties(self):
return self._additional_properties
return self._additional_properties
@additional_properties.setter
def additional_properties(self, additional_properties):
self._additional_properties = additional_properties
self._additional_properties = additional_properties
"
`;

Expand All @@ -81,9 +97,9 @@ exports[`PythonGenerator Class should work with custom preset for \`class\` type
def __init__(self, input):
if hasattr(input, 'property'):
self._property = input.property
self._property = input.property
if hasattr(input, 'additional_properties'):
self._additional_properties = input.additional_properties
self._additional_properties = input.additional_properties
test2
@property
Expand All @@ -97,11 +113,11 @@ exports[`PythonGenerator Class should work with custom preset for \`class\` type
test2
@property
def additional_properties(self):
return self._additional_properties
return self._additional_properties
test3
@additional_properties.setter
def additional_properties(self, additional_properties):
self._additional_properties = additional_properties
self._additional_properties = additional_properties
"
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ exports[`PYTHON_JSON_SERIALIZER_PRESET should render serializer and deserializer
"class Test:
def __init__(self, input):
if hasattr(input, 'prop'):
self._prop = input.prop
self._prop = input.prop
if hasattr(input, 'additional_properties'):
self._additional_properties = input.additional_properties
self._additional_properties = input.additional_properties
@property
def prop(self):
Expand All @@ -17,10 +17,10 @@ exports[`PYTHON_JSON_SERIALIZER_PRESET should render serializer and deserializer
@property
def additional_properties(self):
return self._additional_properties
return self._additional_properties
@additional_properties.setter
def additional_properties(self, additional_properties):
self._additional_properties = additional_properties
self._additional_properties = additional_properties
def serialize_to_json(self):
return json.dumps(self.__dict__, default=lambda o: o.__dict__, indent=2)
Expand Down

0 comments on commit f7046f6

Please sign in to comment.