1
1
import pytest
2
2
3
3
from graphql .core .language .location import SourceLocation
4
- from graphql .core .validation .rules import KnownArgumentNames , KnownDirectives
4
+ from graphql .core .validation .rules import KnownArgumentNames
5
5
from utils import expect_passes_rule , expect_fails_rule
6
6
7
7
@@ -14,7 +14,8 @@ def unknown_arg(arg_name, field_name, type_name, line, column):
14
14
15
15
def unknown_directive_arg (arg_name , directive_name , line , column ):
16
16
return {
17
- 'message' : KnownDirectives .message (arg_name , directive_name ),
17
+ 'message' : KnownArgumentNames .unknown_directive_message (
18
+ arg_name , directive_name ),
18
19
'locations' : [SourceLocation (line , column )]
19
20
}
20
21
@@ -84,8 +85,10 @@ def test_directive_args_are_known():
84
85
''' )
85
86
86
87
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" ))
89
92
def test_undirective_args_are_invalid ():
90
93
expect_fails_rule (KnownArgumentNames , '''
91
94
{
@@ -95,7 +98,7 @@ def test_undirective_args_are_invalid():
95
98
96
99
97
100
@pytest .mark .skipif (not hasattr (KnownArgumentNames , "message" ),
98
- reason = "KnownArgumentNames.method() not yet implemented" )
101
+ reason = "KnownArgumentNames.message not yet implemented" )
99
102
def test_invalid_arg_name ():
100
103
expect_fails_rule (KnownArgumentNames , '''
101
104
fragment invalidArgName on Dog {
@@ -105,7 +108,7 @@ def test_invalid_arg_name():
105
108
106
109
107
110
@pytest .mark .skipif (not hasattr (KnownArgumentNames , "message" ),
108
- reason = "KnownArgumentNames.method() not yet implemented" )
111
+ reason = "KnownArgumentNames.message not yet implemented" )
109
112
def test_unknown_args_amongst_known_args ():
110
113
expect_fails_rule (KnownArgumentNames , '''
111
114
fragment oneGoodArgOneInvalidArg on Dog {
@@ -116,7 +119,7 @@ def test_unknown_args_amongst_known_args():
116
119
117
120
118
121
@pytest .mark .skipif (not hasattr (KnownArgumentNames , "message" ),
119
- reason = "KnownArgumentNames.method() not yet implemented" )
122
+ reason = "KnownArgumentNames.message not yet implemented" )
120
123
def test_unknown_args_deeply ():
121
124
expect_fails_rule (KnownArgumentNames , '''
122
125
{
0 commit comments