Skip to content

Commit 45433d5

Browse files
committed
Rename block_string_value.py to block_string.py
Replicates graphql/graphql-js@f0c3ff4
1 parent a08d5cf commit 45433d5

File tree

5 files changed

+10
-17
lines changed

5 files changed

+10
-17
lines changed

graphql/language/lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from ..error import GraphQLSyntaxError
66
from .source import Source
7-
from .block_string_value import dedent_block_string_value
7+
from .block_string import dedent_block_string_value
88

99
__all__ = ["Lexer", "TokenKind", "Token"]
1010

graphql/language/printer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from .ast import Node, OperationType
66
from .visitor import visit, Visitor
7-
from .block_string_value import print_block_string
7+
from .block_string import print_block_string
88

99
__all__ = ["print_ast"]
1010

graphql/utilities/schema_printer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Any, Callable, Dict, List, Optional, Union, cast
44

55
from ..language import print_ast
6-
from ..language.block_string_value import print_block_string
6+
from ..language.block_string import print_block_string
77
from ..pyutils import inspect
88
from ..type import (
99
DEFAULT_DEPRECATION_REASON,
@@ -264,12 +264,12 @@ def print_description(
264264

265265
lines = description_lines(def_.description, 120 - len(indentation))
266266

267-
text = '\n'.join(lines)
267+
text = "\n".join(lines)
268268
prefer_multiple_lines = len(text) > 70
269-
block_string = print_block_string(text, '', prefer_multiple_lines)
270-
prefix = '\n' + indentation if indentation and not first_in_block else indentation
269+
block_string = print_block_string(text, "", prefer_multiple_lines)
270+
prefix = "\n" + indentation if indentation and not first_in_block else indentation
271271

272-
return prefix + block_string.replace('\n', '\n' + indentation) + '\n'
272+
return prefix + block_string.replace("\n", "\n" + indentation) + "\n"
273273

274274

275275
def escape_quote(line: str) -> str:

tests/language/test_block_string_value.py renamed to tests/language/test_block_string.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
from graphql.language.block_string_value import (
2-
dedent_block_string_value,
3-
print_block_string,
4-
)
1+
from graphql.language.block_string import dedent_block_string_value, print_block_string
52

63

74
def join(*args):
@@ -93,10 +90,7 @@ def with_indentation_and_leading_whitespace():
9390
)
9491

9592
def with_trailing_quote():
96-
assert (
97-
print_block_string('single "line"')
98-
== '"""\nsingle "line"\n"""'
99-
)
93+
assert print_block_string('single "line"') == '"""\nsingle "line"\n"""'
10094

10195
def prefer_multiple_lines():
10296
assert (
@@ -127,8 +121,7 @@ def with_indentation_and_leading_whitespace():
127121

128122
def with_trailing_quote():
129123
assert (
130-
print_block_string('multiple\n"line"')
131-
== '"""\nmultiple\n"line"\n"""'
124+
print_block_string('multiple\n"line"') == '"""\nmultiple\n"line"\n"""'
132125
)
133126

134127
def do_not_prefer_multiple_lines():

0 commit comments

Comments
 (0)