pepkit / looper

A job submitter for Portable Encapsulated Projects
http://looper.databio.org
BSD 2-Clause "Simplified" License
20 stars 7 forks source link

Create test in pytest to check that rendered var_templates are passed back to the pipeline namespace. #357

Closed donaldcampbelljr closed 12 months ago

donaldcampbelljr commented 1 year ago

See: https://github.com/pepkit/looper/issues/356 and https://github.com/pepkit/looper/issues/322 for background.

donaldcampbelljr commented 1 year ago

When rendering var_templates, we assign them such:

pl_iface[VAR_TEMPL_KEY] = self.pl_iface.render_var_templates(namespaces=namespaces)

namespaces["pipeline"]["var_templates"] = pl_iface[VAR_TEMPL_KEY]

This happens in func write_script which is a function of the SubmissionConductor class which is called by the Runner Class during looper run.

To test this specific functionality, we could potentially simulate the parent objects using monkeypatch and ensure that a write_script unittest is:

  1. rendering the var_templates
  2. passing them back to the pipeline namespace