コード例 #1
0
 def returns_false_for_random_garbage():
     assert is_directive(None) is False
     with raises(TypeError):
         assert_directive(None)
     assert is_directive({"what": "is this"}) is False
     with raises(TypeError):
         assert_directive({"what": "is this"})
コード例 #2
0
 def returns_false_for_non_directive():
     assert is_directive(EnumType) is False
     with raises(TypeError):
         assert_directive(EnumType)
     assert is_directive(ScalarType) is False
     with raises(TypeError):
         assert_directive(ScalarType)
コード例 #3
0
 def returns_false_for_directive_class_rather_than_instance():
     assert is_directive(GraphQLDirective) is False
     with raises(TypeError):
         assert_directive(GraphQLScalarType)
コード例 #4
0
 def returns_true_for_spec_defined_directive():
     assert is_directive(GraphQLSkipDirective) is True
     assert_directive(GraphQLSkipDirective)
コード例 #5
0
 def returns_true_for_custom_directive():
     assert is_directive(Directive) is True
     assert_directive(Directive)
コード例 #6
0
 def returns_false_for_random_garbage():
     assert is_directive(None) is False
     assert is_directive({'what': 'is this'}) is False
コード例 #7
0
 def returns_false_for_other_instances():
     assert is_directive(GraphQLString) is False
コード例 #8
0
 def returns_false_for_type_class_rather_than_instance():
     assert is_directive(GraphQLDirective) is False
コード例 #9
0
 def returns_true_for_directive():
     directive = GraphQLDirective('test', [])
     assert is_directive(directive) is True
コード例 #10
0
 def returns_false_for_random_garbage():
     assert is_directive(None) is False
     assert is_directive({"what": "is this"}) is False