client = <FlaskClient <Flask 'swh.graphql.tests.conftest'>>
def test_invalid_swhid(client):
query_str = """
{
resolveSwhid(swhid: "swh:1:dir:dae0d245988b472abd30a4f968b919d0019b6c7") {
nodes {
type
}
}
}
"""
errors = utils.get_error_response(client, query_str)
# API will throw an error in case of an invalid SWHID
> assert len(errors) == 1
E assert 2 == 1
E + where 2 = len([{'message': 'Argument \'swhid\' has invalid value "swh:1:dir:dae0d245988b472abd30a4f968b919d0019b6c7".\n\nGraphQL request:3:27\n2 | {\n3 | resolveSwhid(swhid: "swh:1:dir:dae0d245988b472abd30a4f968b919d0019b6c7") {\n | ^\n4 | nodes {'}, {'locations': [{'column': 27, 'line': 3}], 'message': 'Expected value of type \'SWHID!\', found "swh:1:dir:dae0d245988b472abd30a4f968b919d0019b6c7"; Input error: Invalid SWHID'}])
.tox/py3/lib/python3.7/site-packages/swh/graphql/tests/functional/test_swhid_resolve.py:30: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Sep 2 2022, 3:09 PM