client = <FlaskClient <Flask 'swh.graphql.tests.conftest'>>
directory = Directory(entries=(DirectoryEntry(name=b'file1.ext', type='file', target=hash_to_bytes('86bc6b377e9d25f9d26777a4a28d08...08e64e0c1cb6a4431'), perms=0o160000)), id=hash_to_bytes('87b339104f7dc2a8163dec988445e3987995545f'), raw_manifest=None)
@pytest.mark.parametrize("directory", get_directories())
def test_directory_entry_connection_filter_by_name(client, directory):
storage = server.get_storage()
for dir_entry in storage.directory_ls(directory.id):
name_include = dir_entry["name"][:-1].decode()
query_str = """
{
directory(swhid: "%s") {
swhid
entries(nameInclude: "%s") {
nodes {
targetType
name {
text
}
}
}
}
}
""" % (
directory.swhid(),
name_include,
)
> data, _ = utils.get_query_response(client, query_str)
.tox/py3/lib/python3.7/site-packages/swh/graphql/tests/functional/test_directory_entry.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
client = <FlaskClient <Flask 'swh.graphql.tests.conftest'>>
query_str = '\n {\n directory(swhid: "swh:1:dir:87b339104f7dc2a8163dec988445e3987995545f") {\n swhid\n ... name {\n text\n }\n }\n }\n }\n }\n '
def get_query_response(client, query_str: str) -> Tuple[Dict, Dict]:
response = get_response(client, query_str)
> assert response.status_code == 200, response.data
E AssertionError: b'{"errors":[{"message":"Argument \'first\' of required type \'Int!\' was not provided.\
E \
E GraphQL request:5:13\
E 4 ...line":5}],"message":"Field \'entries\' argument \'first\' of type \'Int!\' is required, but it was not provided."}]}
E '
E assert 400 == 200
E + where 400 = <WrapperTestResponse streamed [400 BAD REQUEST]>.status_code
.tox/py3/lib/python3.7/site-packages/swh/graphql/tests/functional/utils.py:16: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Sep 27 2022, 3:40 PM