<commit_before>package store

import "github.com/stretchr/testify/mock"

// Mock store. Mocks all Store functions using testify.Mock.
type Mock struct {
	mock.Mock

	// Endpoints passed to InitializeMock
	Endpoints []string
	// Options passed to InitializeMock
	Options *Config
}

// InitializeMock creates a Mock store.
func InitializeMock(endpoints []string, options *Config) (Store, error) {
	s := &Mock{}
	s.Endpoints = endpoints
	s.Options = options
	return s, nil
}

// Put mock
func (s *Mock) Put(key string, value []byte) error {
	args := s.Mock.Called(key, value)
	return args.Error(0)
}

// Get mock
func (s *Mock) Get(key string) (*KVPair, error) {
	args := s.Mock.Called(key)
	return args.Get(0).(*KVPair), args.Error(1)
}

// Delete mock
func (s *Mock) Delete(key string) error {
	args := s.Mock.Called(key)
	return args.Error(0)
}

// Exists mock
func (s *Mock) Exists(key string) (bool, error) {
	args := s.Mock.Called(key)
	return args.Bool(0), args.Error(1)
}

// Watch mock
func (s *Mock) Watch(key string, stopCh <-chan struct{}) (<-chan *KVPair, error) {
	args := s.Mock.Called(key, stopCh)
	return args.Get(0).(<-chan *KVPair), args.Error(1)
}

// WatchTree mock
func (s *Mock) WatchTree(prefix string, stopCh <-chan struct{}) (<-chan []*KVPair, error) {
	args := s.Mock.Called(prefix, stopCh)
	return args.Get(0).(<-chan []*KVPair), args.Error(1)
}

// CreateLock mock
func (s *Mock) CreateLock(key string, value []byte) (Locker, error) {
	args := s.Mock.Called(key, value)
	return args.Get(0).(Locker), args.Error(1)
}

// List mock
func (s *Mock) List(prefix string) ([]*KVPair, error) {
	args := s.Mock.Called(prefix)
	return args.Get(0).([]*KVPair), args.Error(1)
}
<commit_msg>discovery: Watch tests for file and some other tests.<commit_after>package store

import "github.com/stretchr/testify/mock"

// Mock store. Mocks all Store functions using testify.Mock.
type Mock struct {
	mock.Mock

	// Endpoints passed to InitializeMock
	Endpoints []string
	// Options passed to InitializeMock
	Options *Config
}

// InitializeMock creates a Mock store.
func InitializeMock(endpoints []string, options *Config) (Store, error) {
	s := &Mock{}
	s.Endpoints = endpoints
	s.Options = options
	return s, nil
}

// Put mock
func (s *Mock) Put(key string, value []byte) error {
	args := s.Mock.Called(key, value)
	return args.Error(0)
}

// Get mock
func (s *Mock) Get(key string) (*KVPair, error) {
	args := s.Mock.Called(key)
	return args.Get(0).(*KVPair), args.Error(1)
}

// Delete mock
func (s *Mock) Delete(key string) error {
	args := s.Mock.Called(key)
	return args.Error(0)
}

// Exists mock
func (s *Mock) Exists(key string) (bool, error) {
	args := s.Mock.Called(key)
	return args.Bool(0), args.Error(1)
}

// Watch mock
func (s *Mock) Watch(key string, stopCh <-chan struct{}) (<-chan *KVPair, error) {
	args := s.Mock.Called(key, stopCh)
	return args.Get(0).(<-chan *KVPair), args.Error(1)
}

// WatchTree mock
func (s *Mock) WatchTree(prefix string, stopCh <-chan struct{}) (<-chan []*KVPair, error) {
	args := s.Mock.Called(prefix, stopCh)
	return args.Get(0).(chan []*KVPair), args.Error(1)
}

// CreateLock mock
func (s *Mock) CreateLock(key string, value []byte) (Locker, error) {
	args := s.Mock.Called(key, value)
	return args.Get(0).(Locker), args.Error(1)
}

// List mock
func (s *Mock) List(prefix string) ([]*KVPair, error) {
	args := s.Mock.Called(prefix)
	return args.Get(0).([]*KVPair), args.Error(1)
}

{'fraction_non_alphanumeric': 0.17005223447475334, 'fraction_numerical': 0.00812536273940801, 'mean_word_length': 4.137108792846497, 'pattern_counts': {'":': 0, '<': 14, '<?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': '2151593', 'n_tokens_mistral': 1277, 'n_tokens_neox': 1274, 'n_words': 358}