def piface_config_bundles(request, resources):
"""
Provide the ATAC-Seq pipeline interface as a fixture, including resources.
Note that this represents the configuration data for the interface for a
single pipeline. In order to use this in the form that a PipelineInterface
expects, this needs to be the value to which a key is mapped within a
larger Mapping.
:param pytest._pytest.fixtures.SubRequest request: hook into test case
requesting this fixture, which is queried for a resources value with
which to override the default if it's present.
:param Mapping resources: pipeline interface resource specification
:return Iterable[Mapping]: collection of bundles of pipeline interface
configuration bundles
"""
iface_config_datas = request.getfixturevalue("config_bundles")
if isinstance(iface_config_datas, Mapping):
data_bundles = iface_config_datas.values()
elif isinstance(iface_config_datas, Iterable):
data_bundles = iface_config_datas
else:
raise TypeError("Expected mapping or list collection of "
"PipelineInterface data: {} ({})".format(
iface_config_datas, type(iface_config_datas)))
resource_specification = request.getfixturevalue("resources") \
if "resources" in request.fixturenames else resources
for config_bundle in data_bundles:
config_bundle.update(resource_specification)
return iface_config_datas
评论列表
文章目录