Exemplo n.º 1
0
    def test_query(self, schema):

        query = schema.query[_.license(key='MIT')]
        assert query == quiz.Query(cls=schema.Query,
                                   selections=quiz.SelectionSet(
                                       quiz.Field('license',
                                                  {'key': 'MIT'}), ))
        with pytest.raises(quiz.SelectionError):
            schema.query[_.foo]
Exemplo n.º 2
0
    def test_query(self, schema):

        query = schema.query[_.license(key="MIT")]
        assert query == quiz.Query(
            cls=schema.Query,
            selections=quiz.SelectionSet(quiz.Field("license",
                                                    {"key": "MIT"})),
        )
        with pytest.raises(quiz.SelectionError):
            schema.query[_.foo]