Improved tests

This commit is contained in:
Syrus Akbary 2016-06-15 00:18:20 -07:00
parent 7caf96c746
commit b91e10ef8a
4 changed files with 6 additions and 6 deletions

View File

@ -64,7 +64,7 @@ script:
flake8
exit
elif [ "$TEST_TYPE" = build ]; then
py.test --cov=graphene
py.test graphene examples --cov=graphene
fi
after_success:
- |

View File

@ -61,7 +61,7 @@ def test_ordered_fields_in_objecttype():
graphql_type = MyObjectType._meta.graphql_type
fields = graphql_type.get_fields()
assert fields.keys() == ['b', 'a', 'field', 'asa']
assert list(fields.keys()) == ['b', 'a', 'field', 'asa']
def test_objecttype_inheritance():
@ -87,12 +87,12 @@ def test_objecttype_as_container_get_fields():
field1 = Field(GraphQLString)
field2 = Field(GraphQLString)
assert Container._meta.graphql_type.get_fields().keys() == ['field1', 'field2']
assert list(Container._meta.graphql_type.get_fields().keys()) == ['field1', 'field2']
def test_parent_container_get_fields():
fields = Container._meta.graphql_type.get_fields()
assert fields.keys() == ['field1', 'field2']
assert list(fields.keys()) == ['field1', 'field2']
def test_objecttype_as_container_only_args():

View File

@ -45,7 +45,7 @@ def test_scalar_in_objecttype(scalar_class, graphql_type):
graphql_type = get_graphql_type(MyObjectType)
fields = graphql_type.get_fields()
assert fields.keys() == ['before', 'field', 'after']
assert list(fields.keys()) == ['before', 'field', 'after']
assert isinstance(fields['field'], Field)

View File

@ -35,4 +35,4 @@ def test_get_graphql_type_unknown_type():
with pytest.raises(Exception) as excinfo:
get_graphql_type(object)
assert "Cannot get GraphQL type of <type 'object'>." == str(excinfo.value)
assert "Cannot get GraphQL type" in str(excinfo.value)