Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
agoscinski committed Nov 21, 2024
1 parent b7ed13b commit 3109b30
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
2 changes: 1 addition & 1 deletion aiida_restapi/identifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def _infer_full_type(self, full_type: Union[str, None]) -> Union[str, None]:
if full_type_.startswith('process.'):
for basepath, full_type_template in self.process_full_type_mapping.items():
if full_type_.startswith(basepath):
plugin_name = strip_prefix(full_type, basepath)
plugin_name = strip_prefix(full_type_, basepath)
if plugin_name.startswith(DEFAULT_NAMESPACE_LABEL):
temp_type_template = self.process_full_type_mapping_unplugged[basepath]
plugin_name = strip_prefix(plugin_name, DEFAULT_NAMESPACE_LABEL + '.')
Expand Down
46 changes: 38 additions & 8 deletions tests/test_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,54 +338,84 @@ def test_get_full_types(default_computers, example_processes, default_groups, de

assert response.status_code == 200, response.json()
assert response.json() == {
'namespace': 'node',
'full_type': 'node.%|',
'label': 'node',
'namespace': 'node',
'path': 'node',
'subspaces': [
{
'namespace': 'data',
'full_type': 'data.%|',
'label': 'Data',
'namespace': 'data',
'path': 'node.data',
'subspaces': [
{
'namespace': 'core',
'full_type': 'data.core.%|',
'label': 'core',
'namespace': 'core',
'path': 'node.data.core',
'subspaces': [
{
'namespace': 'bool',
'full_type': 'data.core.bool.Bool.|',
'label': 'Bool',
'namespace': 'bool',
'path': 'node.data.core.bool',
'subspaces': [],
},
{
'namespace': 'float',
'full_type': 'data.core.float.Float.|',
'label': 'Float',
'namespace': 'float',
'path': 'node.data.core.float',
'subspaces': [],
},
{
'namespace': 'int',
'full_type': 'data.core.int.Int.|',
'label': 'Int',
'namespace': 'int',
'path': 'node.data.core.int',
'subspaces': [],
},
{
'namespace': 'str',
'full_type': 'data.core.str.Str.|',
'label': 'Str',
'namespace': 'str',
'path': 'node.data.core.str',
'subspaces': [],
},
],
}
],
}
},
{
'full_type': 'process.%|%',
'label': 'Process',
'namespace': 'process',
'path': 'node.process',
'subspaces': [
{
'full_type': 'process.workflow.%|%',
'label': 'Workflow',
'namespace': 'workflow',
'path': 'node.process.workflow',
'subspaces': [
{
'full_type': 'process.workflow.workchain.WorkChainNode.|',
'label': 'WorkChainNode',
'namespace': 'workchain',
'path': 'node.process.workflow.workchain',
'subspaces': [],
},
{
'full_type': 'process.workflow.workfunction.WorkFunctionNode.|',
'label': 'WorkFunctionNode',
'namespace': 'workfunction',
'path': 'node.process.workflow.workfunction',
'subspaces': [],
},
],
}
],
},
],
}

0 comments on commit 3109b30

Please sign in to comment.