@@ -28,65 +28,68 @@ def test_one_fragment():
28
28
''' )
29
29
30
30
def test_many_fragments ():
31
- expect_passes_rule (UniqueFragmentNames , '''
32
- {
33
- ...fragA
34
- ...fragB
35
- ...fragC
36
- }
37
- fragment fragA on Type {
38
- fieldA
39
- }
40
- fragment fragB on Type {
41
- fieldB
42
- }
43
- fragment fragC on Type {
44
- fieldC
45
- }
46
- ''' )
47
- def test_inline_fragments ():
48
- expect_passes_rule (UniqueFragmentNames , '''
49
- {
50
- ...on Type {
51
- fieldA
52
- }
53
- ...on Type {
54
- fieldB
55
- }
56
- }
57
- ''' )
58
- def test_fragment_operation_same_name ():
59
- expect_passes_rule (UniqueFragmentNames , '''
60
- query Foo {
61
- ...Foo
62
- }
63
- fragment Foo on Type {
64
- field
65
- }
66
- ''' )
67
- def test_fragments_same_name ():
68
- expect_fails_rule (UniqueFragmentNames , '''
31
+ expect_passes_rule (UniqueFragmentNames , '''
69
32
{
70
33
...fragA
34
+ ...fragB
35
+ ...fragC
71
36
}
72
37
fragment fragA on Type {
73
38
fieldA
74
39
}
75
- fragment fragA on Type {
40
+ fragment fragB on Type {
76
41
fieldB
77
42
}
78
- ''' , [duplicate_fragment ('fragA' , 5 , 16 , 8 , 16 )]
79
- )
43
+ fragment fragC on Type {
44
+ fieldC
45
+ }
46
+ ''' )
80
47
81
- def test_fragments_same_name_no_ref ():
82
- expect_fails_rule (UniqueFragmentNames , '''
83
- fragment fragA on Type {
84
- fieldA
48
+ def test_inline_fragments ():
49
+ expect_passes_rule (UniqueFragmentNames , '''
50
+ {
51
+ ...on Type {
52
+ fieldA
53
+ }
54
+ ...on Type {
55
+ fieldB
56
+ }
85
57
}
86
- fragment fragA on Type {
87
- fieldB
58
+ ''' )
59
+
60
+ def test_fragment_operation_same_name ():
61
+ expect_passes_rule (UniqueFragmentNames , '''
62
+ query Foo {
63
+ ...Foo
88
64
}
89
- ''' , [
90
- duplicate_fragment ('fragA' , 2 , 16 , 5 , 16 )
91
- ]
92
- )
65
+ fragment Foo on Type {
66
+ field
67
+ }
68
+ ''' )
69
+
70
+ def test_fragments_same_name ():
71
+ expect_fails_rule (UniqueFragmentNames , '''
72
+ {
73
+ ...fragA
74
+ }
75
+ fragment fragA on Type {
76
+ fieldA
77
+ }
78
+ fragment fragA on Type {
79
+ fieldB
80
+ }
81
+ ''' , [duplicate_fragment ('fragA' , 5 , 16 , 8 , 16 )]
82
+ )
83
+
84
+ def test_fragments_same_name_no_ref ():
85
+ expect_fails_rule (UniqueFragmentNames , '''
86
+ fragment fragA on Type {
87
+ fieldA
88
+ }
89
+ fragment fragA on Type {
90
+ fieldB
91
+ }
92
+ ''' , [
93
+ duplicate_fragment ('fragA' , 2 , 16 , 5 , 16 )
94
+ ]
95
+ )
0 commit comments