def test_run_from_cli_with_stdin(monkeypatch, config_file, tmpdir): with open(config_file) as f: stdin = StringIO(f.read()) monkeypatch.setattr('sys.stdin', stdin) monkeypatch.setattr('sys.argv', ['multidl', '-n', '4', '-o', str(tmpdir)]) main()
#!/usr/bin/env python from multidl.cli import main if __name__ == '__main__': main()
def test_run_from_cli_with_file(monkeypatch, config_file, tmpdir): monkeypatch.setattr( 'sys.argv', ['multidl', '-n', '4', '-c', config_file, '-o', str(tmpdir)]) main()