Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

2.3 KB
Raw Blame
// Code generated by mockery v2.53.5. DO NOT EDIT.

package mocks

import (
	geo "github.com/posthog/posthog/livestream/geo"
	mock "github.com/stretchr/testify/mock"
)

// GeoLocator is an autogenerated mock type for the GeoLocator type
type GeoLocator struct {
	mock.Mock
}

type GeoLocator_Expecter struct {
	mock *mock.Mock
}

func (_m *GeoLocator) EXPECT() *GeoLocator_Expecter {
	return &GeoLocator_Expecter{mock: &_m.Mock}
}

// Lookup provides a mock function with given fields: ipString
func (_m *GeoLocator) Lookup(ipString string) (geo.GeoLookupResult, error) {
	ret := _m.Called(ipString)

	if len(ret) == 0 {
		panic("no return value specified for Lookup")
	}

	var r0 geo.GeoLookupResult
	var r1 error
	if rf, ok := ret.Get(0).(func(string) (geo.GeoLookupResult, error)); ok {
		return rf(ipString)
	}
	if rf, ok := ret.Get(0).(func(string) geo.GeoLookupResult); ok {
		r0 = rf(ipString)
	} else {
		r0 = ret.Get(0).(geo.GeoLookupResult)
	}

	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(ipString)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// GeoLocator_Lookup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Lookup'
type GeoLocator_Lookup_Call struct {
	*mock.Call
}

// Lookup is a helper method to define mock.On call
//   - ipString string
func (_e *GeoLocator_Expecter) Lookup(ipString interface{}) *GeoLocator_Lookup_Call {
	return &GeoLocator_Lookup_Call{Call: _e.mock.On("Lookup", ipString)}
}

func (_c *GeoLocator_Lookup_Call) Run(run func(ipString string)) *GeoLocator_Lookup_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(string))
	})
	return _c
}

func (_c *GeoLocator_Lookup_Call) Return(_a0 geo.GeoLookupResult, _a1 error) *GeoLocator_Lookup_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *GeoLocator_Lookup_Call) RunAndReturn(run func(string) (geo.GeoLookupResult, error)) *GeoLocator_Lookup_Call {
	_c.Call.Return(run)
	return _c
}

// NewGeoLocator creates a new instance of GeoLocator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewGeoLocator(t interface {
	mock.TestingT
	Cleanup(func())
}) *GeoLocator {
	mock := &GeoLocator{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}