Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 21, 2024
1 parent d77bc51 commit be4faa0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_printer/test_schema_directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ class Query:

assert print_schema(schema) == textwrap.dedent(expected_output).strip()


def test_dedupe_multiple_equal_directives():
class MemberRoleRequired(BasePermission):
message = "Keine Rechte"
Expand All @@ -544,9 +545,11 @@ def has_permission(self, source, info: Info, **kwargs) -> bool:
class MyInterface:
id: strawberry.ID

@strawberry.field(extensions=[PermissionExtension(permissions=[MemberRoleRequired()])])
@strawberry.field(
extensions=[PermissionExtension(permissions=[MemberRoleRequired()])]
)
def hello(info: Info) -> str:
return 'world'
return "world"

Check warning on line 552 in tests/test_printer/test_schema_directives.py

View check run for this annotation

Codecov / codecov/patch

tests/test_printer/test_schema_directives.py#L552

Added line #L552 was not covered by tests

@strawberry.type
class MyType1(MyInterface):
Expand All @@ -558,10 +561,9 @@ class MyType2(MyInterface):

@strawberry.type
class Query:

@strawberry.field
def my_type(info: Info) -> MyInterface:
return MyType1(id='1', name='Hello')
return MyType1(id="1", name="Hello")

Check warning on line 566 in tests/test_printer/test_schema_directives.py

View check run for this annotation

Codecov / codecov/patch

tests/test_printer/test_schema_directives.py#L566

Added line #L566 was not covered by tests

expected_output = """
directive @memberRoleRequired on FIELD_DEFINITION
Expand Down

0 comments on commit be4faa0

Please sign in to comment.