コード例 #1
0
ファイル: test_telemetry.py プロジェクト: cxz/ploomber
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
コード例 #2
0
ファイル: test_custom.py プロジェクト: israelrico007/ploomber
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()
コード例 #3
0
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')