Example #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]
Example #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]