def test_plot_uses_telemetry(custom_args, monkeypatch, tmp_directory): args_defaults = ['python', '--entry-point', 'test_pkg.entry.with_doc'] monkeypatch.setattr(sys, 'argv', args_defaults + custom_args) mock = Mock() monkeypatch.setattr(dag_module.DAG, 'plot', mock) plot.main(catch_exception=False) assert mock.call_count == 1
def test_plot(custom_args, monkeypatch, tmp_sample_dir): args_defaults = ['python', '--entry-point', 'test_pkg.entry.with_doc'] monkeypatch.setattr(sys, 'argv', args_defaults + custom_args) mock = Mock() monkeypatch.setattr(dag_module.DAG, 'plot', mock) plot.main(catch_exception=False) mock.assert_called_once()
def test_plot_uses_name_if_any(tmp_nbs, monkeypatch_session): os.rename('pipeline.yaml', 'pipeline.train.yaml') args_defaults = ['ploomber', '--entry-point', 'pipeline.train.yaml'] monkeypatch_session.setattr(sys, 'argv', args_defaults) mock = Mock() monkeypatch_session.setattr(dag_module.DAG, 'plot', mock) plot.main(catch_exception=False) mock.assert_called_once_with(output='pipeline.train.png')