Skip to content

Commit 6e4b36c

Browse files
committed
TST: KnownArgumentNames fixed unknown directive message
Per @dittos request: dittos/graphqllib#12 (comment) Turns out I had used the wrong class, oops :)
1 parent d4d32cb commit 6e4b36c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

tests/core_validation/test_known_argument_names.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22

33
from graphql.core.language.location import SourceLocation
4-
from graphql.core.validation.rules import KnownArgumentNames, KnownDirectives
4+
from graphql.core.validation.rules import KnownArgumentNames
55
from utils import expect_passes_rule, expect_fails_rule
66

77

@@ -14,7 +14,8 @@ def unknown_arg(arg_name, field_name, type_name, line, column):
1414

1515
def unknown_directive_arg(arg_name, directive_name, line, column):
1616
return {
17-
'message': KnownDirectives.message(arg_name, directive_name),
17+
'message': KnownArgumentNames.unknown_directive_message(
18+
arg_name, directive_name),
1819
'locations': [SourceLocation(line, column)]
1920
}
2021

@@ -84,8 +85,10 @@ def test_directive_args_are_known():
8485
''')
8586

8687

87-
@pytest.mark.skipif(not hasattr(KnownDirectives, "message"),
88-
reason="KnownDirectives.method() not yet implemented")
88+
@pytest.mark.skipif(not hasattr(KnownArgumentNames,
89+
"unknown_directive_message"),
90+
reason=("KnownDirectives.unknown_directive_message not "
91+
"yet implemented"))
8992
def test_undirective_args_are_invalid():
9093
expect_fails_rule(KnownArgumentNames, '''
9194
{
@@ -95,7 +98,7 @@ def test_undirective_args_are_invalid():
9598

9699

97100
@pytest.mark.skipif(not hasattr(KnownArgumentNames, "message"),
98-
reason="KnownArgumentNames.method() not yet implemented")
101+
reason="KnownArgumentNames.message not yet implemented")
99102
def test_invalid_arg_name():
100103
expect_fails_rule(KnownArgumentNames, '''
101104
fragment invalidArgName on Dog {
@@ -105,7 +108,7 @@ def test_invalid_arg_name():
105108

106109

107110
@pytest.mark.skipif(not hasattr(KnownArgumentNames, "message"),
108-
reason="KnownArgumentNames.method() not yet implemented")
111+
reason="KnownArgumentNames.message not yet implemented")
109112
def test_unknown_args_amongst_known_args():
110113
expect_fails_rule(KnownArgumentNames, '''
111114
fragment oneGoodArgOneInvalidArg on Dog {
@@ -116,7 +119,7 @@ def test_unknown_args_amongst_known_args():
116119

117120

118121
@pytest.mark.skipif(not hasattr(KnownArgumentNames, "message"),
119-
reason="KnownArgumentNames.method() not yet implemented")
122+
reason="KnownArgumentNames.message not yet implemented")
120123
def test_unknown_args_deeply():
121124
expect_fails_rule(KnownArgumentNames, '''
122125
{

0 commit comments

Comments
 (0)