<commit_before>package healthy

import (
	"testing"
	"time"

	"github.com/Nitro/sidecar/service"
	"github.com/relistan/go-director"
	. "github.com/smartystreets/goconvey/convey"
)

var hostname string = "indefatigable"

type mockDiscoverer struct {
	listFn func() []service.Service
}

func (m *mockDiscoverer) Services() []service.Service {
	return m.listFn()
}

func (m *mockDiscoverer) HealthCheck(svc *service.Service) (string, string) {
	if svc.Name == "hasCheck" {
		return "HttpGet", "http://{{ host }}:{{ tcp 8081 }}/status/check"
	}

	if svc.Name == "containerCheck" {
		return "HttpGet", "http://{{ container }}:{{ tcp 8081 }}/status/check"
	}

	return "", ""
}<commit_msg>Fix tests for healthy module<commit_after>package healthy

import (
	"testing"
	"time"

	"github.com/Nitro/sidecar/service"
	"github.com/relistan/go-director"
	. "github.com/smartystreets/goconvey/convey"
	"github.com/Nitro/sidecar/discovery"
)

var hostname string = "indefatigable"

type mockDiscoverer struct {
	listFn func() []service.Service
}

func (m *mockDiscoverer) Services() []service.Service {
	return m.listFn()
}

func (m *mockDiscoverer) Listeners() []discovery.ChangeListener {
	return nil
}

func (m *mockDiscoverer) HealthCheck(svc *service.Service) (string, string) {
	if svc.Name == "hasCheck" {
		return "HttpGet", "http://{{ host }}:{{ tcp 8081 }}/status/check"
	}

	if svc.Name == "containerCheck" {
		return "HttpGet", "http://{{ container }}:{{ tcp 8081 }}/status/check"
	}

	return "", ""
}
{'fraction_non_alphanumeric': 0.17089452603471295, 'fraction_numerical': 0.010680907877169559, 'mean_word_length': 4.5724907063197024, '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': '4528972', 'n_tokens_mistral': 581, 'n_tokens_neox': 548, 'n_words': 118}