Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/tests/functional/test_directory_entry.py
Show All 20 Lines | def get_target_type(target_type): | ||||
return mapping.get(target_type) | return mapping.get(target_type) | ||||
def test_get_directory_entry_missing_path(client): | def test_get_directory_entry_missing_path(client): | ||||
directory = get_directories()[0] | directory = get_directories()[0] | ||||
path = "missing" | path = "missing" | ||||
query_str = """ | query_str = """ | ||||
query getDirEntry($swhid: SWHID!, $path: String!) { | query getDirEntry($swhid: SWHID!, $path: String!) { | ||||
directoryEntry(directorySwhid: $swhid, path: $path) { | directoryEntry(directorySWHID: $swhid, path: $path) { | ||||
name { | name { | ||||
text | text | ||||
} | } | ||||
targetType | targetType | ||||
target { | target { | ||||
...on Content { | ...on Content { | ||||
swhid | swhid | ||||
} | } | ||||
Show All 12 Lines | |||||
@pytest.mark.parametrize( | @pytest.mark.parametrize( | ||||
"directory", get_directories() + get_directories_with_nested_path() | "directory", get_directories() + get_directories_with_nested_path() | ||||
) | ) | ||||
def test_get_directory_entry(client, directory): | def test_get_directory_entry(client, directory): | ||||
storage = server.get_storage() | storage = server.get_storage() | ||||
query_str = """ | query_str = """ | ||||
query getDirEntry($swhid: SWHID!, $path: String!) { | query getDirEntry($swhid: SWHID!, $path: String!) { | ||||
directoryEntry(directorySwhid: $swhid, path: $path) { | directoryEntry(directorySWHID: $swhid, path: $path) { | ||||
name { | name { | ||||
text | text | ||||
} | } | ||||
targetType | targetType | ||||
target { | target { | ||||
...on Content { | ...on Content { | ||||
swhid | swhid | ||||
} | } | ||||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |