client = <FlaskClient <Flask 'swh.graphql.tests.conftest'>>
def test_get_revision_with_invalid_swhid(client):
query_str = """
{
revision(swhid: "swh:1:cnt:invalid") {
swhid
}
}
"""
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:cnt:invalid".\n\nGraphQL request:3:23\n2 | {\n3 | revision(swhid: "swh:1:cnt:invalid") {\n | ^\n4 | swhid'}, {'locations': [{'column': 23, 'line': 3}], 'message': 'Expected value of type \'SWHID!\', found "swh:1:cnt:invalid"; Input error: Invalid SWHID'}])
.tox/py3/lib/python3.7/site-packages/swh/graphql/tests/functional/test_revision.py:85: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Sep 2 2022, 3:09 PM