Skip to content

style: Update Black #394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def sync(
nullable_model_prop: Union[Unset, None, ModelWithUnionProperty] = UNSET,
nullable_required_model_prop: Optional[ModelWithUnionProperty],
) -> Optional[Union[HTTPValidationError, None]]:
""" """
""" """

return sync_detailed(
client=client,
Expand Down Expand Up @@ -315,7 +315,7 @@ async def asyncio(
nullable_model_prop: Union[Unset, None, ModelWithUnionProperty] = UNSET,
nullable_required_model_prop: Optional[ModelWithUnionProperty],
) -> Optional[Union[HTTPValidationError, None]]:
""" """
""" """

return (
await asyncio_detailed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def sync(
*,
client: Client,
) -> Optional[List[bool]]:
""" Get a list of booleans """
"""Get a list of booleans"""

return sync_detailed(
client=client,
Expand All @@ -84,7 +84,7 @@ async def asyncio(
*,
client: Client,
) -> Optional[List[bool]]:
""" Get a list of booleans """
"""Get a list of booleans"""

return (
await asyncio_detailed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def sync(
*,
client: Client,
) -> Optional[List[float]]:
""" Get a list of floats """
"""Get a list of floats"""

return sync_detailed(
client=client,
Expand All @@ -84,7 +84,7 @@ async def asyncio(
*,
client: Client,
) -> Optional[List[float]]:
""" Get a list of floats """
"""Get a list of floats"""

return (
await asyncio_detailed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def sync(
*,
client: Client,
) -> Optional[List[int]]:
""" Get a list of integers """
"""Get a list of integers"""

return sync_detailed(
client=client,
Expand All @@ -84,7 +84,7 @@ async def asyncio(
*,
client: Client,
) -> Optional[List[int]]:
""" Get a list of integers """
"""Get a list of integers"""

return (
await asyncio_detailed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def sync(
*,
client: Client,
) -> Optional[List[str]]:
""" Get a list of strings """
"""Get a list of strings"""

return sync_detailed(
client=client,
Expand All @@ -84,7 +84,7 @@ async def asyncio(
*,
client: Client,
) -> Optional[List[str]]:
""" Get a list of strings """
"""Get a list of strings"""

return (
await asyncio_detailed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def sync(
an_enum_value: List[AnEnum],
some_date: Union[datetime.date, datetime.datetime],
) -> Optional[Union[HTTPValidationError, List[AModel]]]:
""" Get a list of things """
"""Get a list of things"""

return sync_detailed(
client=client,
Expand Down Expand Up @@ -135,7 +135,7 @@ async def asyncio(
an_enum_value: List[AnEnum],
some_date: Union[datetime.date, datetime.datetime],
) -> Optional[Union[HTTPValidationError, List[AModel]]]:
""" Get a list of things """
"""Get a list of things"""

return (
await asyncio_detailed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def sync(
client: Client,
int_enum: AnIntEnum,
) -> Optional[Union[HTTPValidationError, None]]:
""" """
""" """

return sync_detailed(
client=client,
Expand Down Expand Up @@ -106,7 +106,7 @@ async def asyncio(
client: Client,
int_enum: AnIntEnum,
) -> Optional[Union[HTTPValidationError, None]]:
""" """
""" """

return (
await asyncio_detailed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def sync(
client: Client,
json_body: AModel,
) -> Optional[Union[HTTPValidationError, None]]:
""" Try sending a JSON body """
"""Try sending a JSON body"""

return sync_detailed(
client=client,
Expand Down Expand Up @@ -101,7 +101,7 @@ async def asyncio(
client: Client,
json_body: AModel,
) -> Optional[Union[HTTPValidationError, None]]:
""" Try sending a JSON body """
"""Try sending a JSON body"""

return (
await asyncio_detailed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def sync(
*,
client: Client,
) -> Optional[File]:
""" """
""" """

return sync_detailed(
client=client,
Expand All @@ -85,7 +85,7 @@ async def asyncio(
*,
client: Client,
) -> Optional[File]:
""" """
""" """

return (
await asyncio_detailed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def sync(
client: Client,
query_param: Union[Unset, List[str]] = UNSET,
) -> Optional[Union[HTTPValidationError, None]]:
""" Test optional query parameters """
"""Test optional query parameters"""

return sync_detailed(
client=client,
Expand Down Expand Up @@ -107,7 +107,7 @@ async def asyncio(
client: Client,
query_param: Union[Unset, List[str]] = UNSET,
) -> Optional[Union[HTTPValidationError, None]]:
""" Test optional query parameters """
"""Test optional query parameters"""

return (
await asyncio_detailed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def sync(
client: Client,
json_body: TestInlineObjectsJsonBody,
) -> Optional[TestInlineObjectsResponse200]:
""" """
""" """

return sync_detailed(
client=client,
Expand Down Expand Up @@ -97,7 +97,7 @@ async def asyncio(
client: Client,
json_body: TestInlineObjectsJsonBody,
) -> Optional[TestInlineObjectsResponse200]:
""" """
""" """

return (
await asyncio_detailed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def sync(
multipart_data: BodyUploadFileTestsUploadPost,
keep_alive: Union[Unset, bool] = UNSET,
) -> Optional[Union[HTTPValidationError, None]]:
""" Upload a file """
"""Upload a file"""

return sync_detailed(
client=client,
Expand Down Expand Up @@ -119,7 +119,7 @@ async def asyncio(
multipart_data: BodyUploadFileTestsUploadPost,
keep_alive: Union[Unset, bool] = UNSET,
) -> Optional[Union[HTTPValidationError, None]]:
""" Upload a file """
"""Upload a file"""

return (
await asyncio_detailed(
Expand Down
14 changes: 7 additions & 7 deletions end_to_end_tests/golden-record/my_test_api_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,42 @@

@attr.s(auto_attribs=True)
class Client:
""" A class for keeping track of data related to the API """
"""A class for keeping track of data related to the API"""

base_url: str
cookies: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
headers: Dict[str, str] = attr.ib(factory=dict, kw_only=True)
timeout: float = attr.ib(5.0, kw_only=True)

def get_headers(self) -> Dict[str, str]:
""" Get headers to be used in all endpoints """
"""Get headers to be used in all endpoints"""
return {**self.headers}

def with_headers(self, headers: Dict[str, str]) -> "Client":
""" Get a new client matching this one with additional headers """
"""Get a new client matching this one with additional headers"""
return attr.evolve(self, headers={**self.headers, **headers})

def get_cookies(self) -> Dict[str, str]:
return {**self.cookies}

def with_cookies(self, cookies: Dict[str, str]) -> "Client":
""" Get a new client matching this one with additional cookies """
"""Get a new client matching this one with additional cookies"""
return attr.evolve(self, cookies={**self.cookies, **cookies})

def get_timeout(self) -> float:
return self.timeout

def with_timeout(self, timeout: float) -> "Client":
""" Get a new client matching this one with a new timeout (in seconds) """
"""Get a new client matching this one with a new timeout (in seconds)"""
return attr.evolve(self, timeout=timeout)


@attr.s(auto_attribs=True)
class AuthenticatedClient(Client):
""" A Client which has been authenticated for use on secured endpoints """
"""A Client which has been authenticated for use on secured endpoints"""

token: str

def get_headers(self) -> Dict[str, str]:
""" Get headers to be used in authenticated endpoints """
"""Get headers to be used in authenticated endpoints"""
return {"Authorization": f"Bearer {self.token}", **self.headers}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@attr.s(auto_attribs=True)
class AModel:
""" A Model for testing all the ways custom objects can be used """
"""A Model for testing all the ways custom objects can be used"""

an_enum_value: AnEnum
a_camel_date_time: Union[datetime.date, datetime.datetime]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@attr.s(auto_attribs=True)
class AllOfSubModel:
""" """
""" """

a_sub_property: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@attr.s(auto_attribs=True)
class AnotherAllOfSubModel:
""" """
""" """

another_sub_property: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@attr.s(auto_attribs=True)
class BodyUploadFileTestsUploadPost:
""" """
""" """

some_file: File
some_string: Union[Unset, str] = "some_default_string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@attr.s(auto_attribs=True)
class FreeFormModel:
""" """
""" """

additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@attr.s(auto_attribs=True)
class HTTPValidationError:
""" """
""" """

detail: Union[Unset, List[ValidationError]] = UNSET

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@attr.s(auto_attribs=True)
class ModelFromAllOf:
""" """
""" """

a_sub_property: Union[Unset, str] = UNSET
another_sub_property: Union[Unset, str] = UNSET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@attr.s(auto_attribs=True)
class ModelName:
""" """
""" """

additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@attr.s(auto_attribs=True)
class ModelWithAdditionalPropertiesInlined:
""" """
""" """

a_number: Union[Unset, float] = UNSET
additional_properties: Dict[str, ModelWithAdditionalPropertiesInlinedAdditionalProperty] = attr.ib(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@attr.s(auto_attribs=True)
class ModelWithAdditionalPropertiesInlinedAdditionalProperty:
""" """
""" """

extra_props_prop: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@attr.s(auto_attribs=True)
class ModelWithAdditionalPropertiesRefed:
""" """
""" """

additional_properties: Dict[str, AnEnum] = attr.ib(init=False, factory=dict)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@attr.s(auto_attribs=True)
class ModelWithAnyJsonProperties:
""" """
""" """

additional_properties: Dict[
str, Union[List[str], ModelWithAnyJsonPropertiesAdditionalPropertyType0, bool, float, int, str]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@attr.s(auto_attribs=True)
class ModelWithAnyJsonPropertiesAdditionalPropertyType0:
""" """
""" """

additional_properties: Dict[str, str] = attr.ib(init=False, factory=dict)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@attr.s(auto_attribs=True)
class ModelWithPrimitiveAdditionalProperties:
""" """
""" """

a_date_holder: Union[Unset, ModelWithPrimitiveAdditionalPropertiesADateHolder] = UNSET
additional_properties: Dict[str, str] = attr.ib(init=False, factory=dict)
Expand Down
Loading