def test_default_config_source(mock_ubipopulate): args = [ "--pulp-hostname", "foo.pulp.com", "--user", "foo", "--pass", "foo" ] main(args) mock_ubipopulate.assert_called_once_with( "foo.pulp.com", ("foo", "foo"), False, [], None, False, 4, None, content_sets=None, repo_ids=None, version=None, content_set_regex=None, )
def test_crt(mock_ubipopulate): args = [ "--pulp-hostname", "foo.pulp.com", "--cert", "/cert.cert", "--conf-src", "custom/conf/dir", ] main(args) mock_ubipopulate.assert_called_once_with( "foo.pulp.com", ("/cert.cert", ), False, [], "custom/conf/dir", False, 4, None, content_sets=None, repo_ids=None, version=None, content_set_regex=None, )
def test_default_config_source(mock_ubipopulate): args = ['--pulp-hostname', 'foo.pulp.com', '--user', 'foo', '--pass', 'foo'] main(args) mock_ubipopulate.assert_called_once_with('foo.pulp.com', ('foo', 'foo'), False, [], None, False, 4, None, content_sets=None, repo_ids=None)
def test_help(): args = ['--help'] with pytest.raises(SystemExit) as e_info: main(args) assert e_info.value.code == 0
def test_dry_run(mock_ubipopulate): args = ['--pulp-hostname', 'foo.pulp.com', '--user', 'foo', '--pass', 'foo', '--conf-src', 'custom/conf/dir', 'f1', 'f2', '--dry-run'] main(args) mock_ubipopulate.assert_called_once_with('foo.pulp.com', ('foo', 'foo'), True, ['f1', 'f2'], 'custom/conf/dir', False, 4, None)
def test_specified_filenames(mock_ubipopulate): args = ['--pulp-hostname', 'foo.pulp.com', '--user', 'foo', '--pass', 'foo', '--conf-src', 'custom/conf/dir', 'f1', 'f2'] main(args) mock_ubipopulate.assert_called_once_with('foo.pulp.com', ('foo', 'foo'), False, ['f1', 'f2'], 'custom/conf/dir', False, 4, None)
def test_crt(mock_ubipopulate): args = ['--pulp-hostname', 'foo.pulp.com', '--cert', '/cert.cert', '--conf-src', 'custom/conf/dir'] main(args) mock_ubipopulate.assert_called_once_with('foo.pulp.com', ('/cert.cert', ), False, [], 'custom/conf/dir', False, 4, None)
def test_custom_config_source(mock_ubipopulate): args = ['--pulp-hostname', 'foo.pulp.com', '--user', 'foo', '--pass', 'foo', '--conf-src', 'custom/conf/dir'] main(args) mock_ubipopulate.assert_called_once_with('foo.pulp.com', ('foo', 'foo'), False, [], 'custom/conf/dir', False, 4, None)
def test_output_file(mock_ubipopulate): args = ['--pulp-hostname', 'foo.pulp.com', '--user', 'foo', '--pass', 'foo', '--output-repos', '/foo/out/repos.txt'] main(args) mock_ubipopulate.assert_called_once_with('foo.pulp.com', ('foo', 'foo'), False, [], None, False, 4, '/foo/out/repos.txt')
def test_insecure(mock_ubipopulate): args = ['--pulp-hostname', 'foo.pulp.com', '--user', 'foo', '--pass', 'foo', '--conf-src', 'custom/conf/dir', 'f1', 'f2', '--workers', '42', '--insecure'] main(args) mock_ubipopulate.assert_called_once_with('foo.pulp.com', ('foo', 'foo'), False, ['f1', 'f2'], 'custom/conf/dir', True, 42, None)