<commit_before>package yum

import (
	"path/filepath"
	"testing"

	"github.com/gonuts/logger"
)

func getTestClient(t *testing.T) (*Client, error) {
	const siteroot = "testdata/mysiteroot"
	client := &Client{
		msg:         logger.New("yum"),
		siteroot:    siteroot,
		etcdir:      filepath.Join(siteroot, "etc"),
		lbyumcache:  filepath.Join(siteroot, "var", "cache", "lbyum"),
		yumconf:     filepath.Join(siteroot, "etc", "yum.conf"),
		yumreposdir: filepath.Join(siteroot, "etc", "yum.repos.d"),
		configured:  false,
		repos:       make(map[string]*Repository),
		repourls:    make(map[string]string),
	}
	setupBackend := false
	checkForUpdates := true
	repo, err := NewRepository("testrepo", "http://dummy-url.org", "testdata/cachedir.tmp",
		[]string{"RepositoryXMLBackend"},
		setupBackend,
		checkForUpdates,
	)
	if err != nil {
		return nil, err
	}
<commit_msg>test: use yum.newClient<commit_after>package yum

import (
	"testing"
)

func getTestClient(t *testing.T) (*Client, error) {
	const siteroot = "testdata/mysiteroot"
	checkForUpdates := true
	manualConfig := true
	client, err := newClient(
		siteroot,
		[]string{"RepositoryXMLBackend"},
		checkForUpdates,
		manualConfig,
	)
	setupBackend := false
	repo, err := NewRepository("testrepo", "http://dummy-url.org", "testdata/cachedir.tmp",
		[]string{"RepositoryXMLBackend"},
		setupBackend,
		checkForUpdates,
	)
	if err != nil {
		return nil, err
	}

{'fraction_non_alphanumeric': 0.15552427867698804, 'fraction_numerical': 0.0, 'mean_word_length': 4.4903474903474905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4365770', 'n_tokens_mistral': 550, 'n_tokens_neox': 529, 'n_words': 101}