client = <FlaskClient <Flask 'swh.graphql.tests.conftest'>>
def test_get_content_with_invalid_hash_algorithm(client):
content = get_contents()[0]
query_str = """
{
contentByHash(checksums: ["test:%s"]) {
swhid
}
}
"""
errors = utils.get_error_response(client, query_str % content.sha1.hex())
> assert len(errors) == 1
E assert 2 == 1
E + where 2 = len([{'message': 'Argument \'checksums\' has invalid value ["test:4fb76b6b9fd94175a35581ff7ae5e44d6cb8aabb"].\n\nGraphQL request:3:32\n2 | {\n3 | contentByHash(checksums: ["test:4fb76b6b9fd94175a35581ff7ae5e44d6cb8aabb"]) {\n | ^\n4 | swhid'}, {'locations': [{'column': 33, 'line': 3}], 'message': 'Expected value of type \'ContentHash\', found "test:4fb76b6b9fd94175a35581ff7ae5e44d6cb8aabb"; Input error: Invalid hash algorithm'}])
.tox/py3/lib/python3.7/site-packages/swh/graphql/tests/functional/test_content.py:133: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Sep 30 2022, 3:34 PM