diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfa0aef1..248f62eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,14 +41,13 @@ jobs: with: node-version: 18 - - name: Build - run: make build + - name: Test + run: make test-ci env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Test - run: "go test -v -race -short -coverprofile='coverage.out' ./..." - shell: bash + - name: Build + run: make build - name: Code coverage with codecov uses: codecov/codecov-action@v4 diff --git a/.gitignore b/.gitignore index c41514bb..fb0293be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,6 @@ /.idea /.vscode/*log -# legacy python version -/.pytest_cache -/scripts/deploy.sh -*.pyc -/src/resticprofile.egg-info -/**/.eggs - .DS_Store /examples/private /build/restic* @@ -21,8 +14,7 @@ # test output /coverage.out -# mocks & mock binaries -mocks +# mock binaries /mock /echo /lock/locktest diff --git a/.godownloader.yml b/.godownloader.yml index ab61bc80..4517c960 100644 --- a/.godownloader.yml +++ b/.godownloader.yml @@ -1,33 +1,77 @@ project_name: resticprofile builds: - - id: resticprofile_targz + - id: darwin_targz env: - CGO_ENABLED=0 goos: - darwin + goarch: + - amd64 + - arm64 + - id: freebsd_targz + env: + - CGO_ENABLED=0 + goos: - freebsd + goarch: + - "386" + - amd64 + - arm + goarm: + - "6" + - "7" + - id: linux_targz + env: + - CGO_ENABLED=0 + goos: - linux - - windows goarch: - "386" - amd64 - arm - arm64 + - mips + - mips64 + - mips64le + - mipsle + - ppc64 + - ppc64le + - riscv64 + - s390x goarm: - "6" - "7" - ignore: - - goos: darwin - goarch: "386" - - goos: darwin - goarch: arm - - goos: freebsd - goarch: arm64 - - goos: windows - goarch: arm - - goos: windows - goarch: arm64 + - id: netbsd_targz + env: + - CGO_ENABLED=0 + goos: + - netbsd + goarch: + - amd64 + - id: openbsd_targz + env: + - CGO_ENABLED=0 + goos: + - openbsd + goarch: + - "386" + - amd64 + - id: solaris_targz + env: + - CGO_ENABLED=0 + goos: + - solaris + goarch: + - amd64 + - id: windows_targz + env: + - CGO_ENABLED=0 + goos: + - windows + goarch: + - "386" + - amd64 - id: resticprofile_zip env: @@ -42,27 +86,8 @@ builds: ignore: - goos: darwin goarch: "386" + - goos: windows + goarch: arm -archives: - - id: targz - builds: - - resticprofile_targz - format: tar.gz - - - id: zip - builds: - - resticprofile_zip - format: zip - checksum: - name_template: 'checksums.txt' - -snapshot: - name_template: "{{ .Tag }}-next" - -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' + name_template: 'checksums.txt' diff --git a/.goreleaser-docker-only.yml b/.goreleaser-docker-only.yml index c8ae4f67..54e4aa56 100644 --- a/.goreleaser-docker-only.yml +++ b/.goreleaser-docker-only.yml @@ -39,9 +39,14 @@ dockers: - build/restic-amd64 - build/rclone-amd64 build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" - "--platform=linux/amd64" - "--build-arg=ARCH=amd64" - skip_push: true # remove after Sunday + - image_templates: - "creativeprojects/resticprofile:latest-arm64v8" - "creativeprojects/resticprofile:{{ .RawVersion }}-arm64v8" @@ -55,21 +60,24 @@ dockers: - build/restic-arm64 - build/rclone-arm64 build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" - "--platform=linux/arm64/v8" - "--build-arg=ARCH=arm64" - skip_push: true # remove after Sunday docker_manifests: - name_template: creativeprojects/resticprofile:{{ .RawVersion }} image_templates: - creativeprojects/resticprofile:{{ .RawVersion }}-amd64 - creativeprojects/resticprofile:{{ .RawVersion }}-arm64v8 - skip_push: true # remove after Sunday + - name_template: creativeprojects/resticprofile:latest image_templates: - creativeprojects/resticprofile:latest-amd64 - creativeprojects/resticprofile:latest-arm64v8 - skip_push: true # remove after Sunday release: disable: true diff --git a/.goreleaser-snapshot.yml b/.goreleaser-snapshot.yml index 88d260c2..d0e66b6f 100644 --- a/.goreleaser-snapshot.yml +++ b/.goreleaser-snapshot.yml @@ -38,6 +38,11 @@ dockers: - build/restic-amd64 - build/rclone-amd64 build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" - "--platform=linux/amd64" - "--build-arg=ARCH=amd64" - image_templates: @@ -52,5 +57,10 @@ dockers: - build/restic-arm64 - build/rclone-arm64 build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" - "--platform=linux/arm64/v8" - "--build-arg=ARCH=arm64" diff --git a/.goreleaser.yml b/.goreleaser.yml index 170dba20..5f567ff7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,26 +17,47 @@ builds: - darwin - freebsd - linux + - netbsd + - openbsd + - solaris - windows goarch: - "386" - amd64 - arm - arm64 + - mips + - mips64 + - mips64le + - mipsle + - ppc64 + - ppc64le + - riscv64 + - s390x goarm: - "6" - "7" ignore: - - goos: darwin + - goos: freebsd + goarch: arm64 + - goos: freebsd + goarch: riscv64 + - goos: netbsd goarch: "386" - - goos: darwin + - goos: netbsd goarch: arm - - goos: freebsd + - goos: netbsd goarch: arm64 - goos: windows goarch: arm - goos: windows goarch: arm64 + - goos: openbsd + goarch: arm + - goos: openbsd + goarch: arm64 + - goos: openbsd + goarch: ppc64 - id: resticprofile_zip env: @@ -48,9 +69,6 @@ builds: - "386" - amd64 - arm64 - ignore: - - goos: darwin - goarch: "386" - id: resticprofile_no_self_update env: @@ -86,17 +104,19 @@ archives: - id: targz builds: - resticprofile_targz + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}' format: tar.gz - id: targz_no_self_update builds: - resticprofile_no_self_update - name_template: '{{ .ProjectName }}_no_self_update_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}' + name_template: '{{ .ProjectName }}_no_self_update_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}' format: tar.gz - id: zip builds: - resticprofile_zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}' format: zip checksum: @@ -126,6 +146,11 @@ dockers: - build/restic-amd64 - build/rclone-amd64 build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" - "--platform=linux/amd64" - "--build-arg=ARCH=amd64" - image_templates: @@ -141,6 +166,11 @@ dockers: - build/restic-arm64 - build/rclone-arm64 build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" - "--platform=linux/arm64/v8" - "--build-arg=ARCH=arm64" diff --git a/Makefile b/Makefile index 37baaf09..4dc233df 100644 --- a/Makefile +++ b/Makefile @@ -58,12 +58,12 @@ TOC_START=<\!--ts--> TOC_END=<\!--te--> TOC_PATH=toc.md -all: prepare test build +all: prepare_test test build .PHONY: test test-ci coverage .PHONY: download download-restic-key .PHONY: build build-mac build-linux build-pi build-windows build-no-selfupdate build-all .PHONY: generate-config-reference generate-jsonschema generate-install generate-restic -.PHONY: all verify prepare install clean ramdisk rest-server nightly toc syslog checkdoc +.PHONY: all verify prepare_test prepare_build install clean ramdisk rest-server nightly toc syslog checkdoc verify: ifeq ($(wildcard $(GOPATH)/.),) @@ -78,17 +78,23 @@ $(GOBIN)/eget: verify $(GOBIN)/goreleaser: verify $(GOBIN)/eget @echo "[*] $@" - "$(GOBIN)/eget" goreleaser/goreleaser --upgrade-only --to $(GOBIN) + "$(GOBIN)/eget" goreleaser/goreleaser --upgrade-only --to '$(GOBIN)' $(GOBIN)/github-markdown-toc.go: verify $(GOBIN)/eget @echo "[*] $@" - "$(GOBIN)/eget" ekalinin/github-markdown-toc.go --upgrade-only --file gh-md-toc --to $(GOBIN) + "$(GOBIN)/eget" ekalinin/github-markdown-toc.go --upgrade-only --file gh-md-toc --to '$(GOBIN)' -prepare: verify download $(GOBIN)/eget +$(GOBIN)/mockery: verify $(GOBIN)/eget @echo "[*] $@" - GOBIN="$(GOBIN)" \ - GOPATH="$(GOPATH)" \ - $(GOCMD) generate ./... + "$(GOBIN)/eget" vektra/mockery --upgrade-only --to '$(GOBIN)' + +prepare_build: verify download + @echo "[*] $@" + +prepare_test: verify download $(GOBIN)/mockery + @echo "[*] $@" + find . -path "*/mocks/*" -exec rm {} \; + "$(GOBIN)/mockery" --config .mockery.yaml download: verify @echo "[*] $@" @@ -100,41 +106,41 @@ download-restic-key: KEY_FILE=$(abspath restic/gpg-key.asc) curl https://restic.net/gpg-key-alex.asc > $(KEY_FILE) -install: prepare +install: prepare_build @echo "[*] $@" GOBIN="$(GOBIN)" \ $(GOINSTALL) -v -ldflags "-X 'main.commit=${BUILD_COMMIT}' -X 'main.date=${BUILD_DATE}' -X 'main.builtBy=make'" -build: prepare +build: prepare_build @echo "[*] $@" GOPATH="$(GOPATH)" \ $(GOBUILD) -o $(BINARY) -v -ldflags "-X 'main.commit=${BUILD_COMMIT}' -X 'main.date=${BUILD_DATE}' -X 'main.builtBy=make'" -build-no-selfupdate: prepare +build-no-selfupdate: prepare_build @echo "[*] $@" GOPATH="$(GOPATH)" \ $(GOBUILD) -o $(BINARY) -v -tags no_self_update -ldflags "-X 'main.commit=${BUILD_COMMIT}' -X 'main.date=${BUILD_DATE}' -X 'main.builtBy=make'" -build-mac: prepare +build-mac: prepare_build @echo "[*] $@" GOPATH="$(GOPATH)" \ GOOS="darwin" GOARCH="amd64" $(GOBUILD) -o $(BINARY_DARWIN_AMD64) -v -ldflags "-X 'main.commit=${BUILD_COMMIT}' -X 'main.date=${BUILD_DATE}' -X 'main.builtBy=make'" GOPATH="$(GOPATH)" \ GOOS="darwin" GOARCH="arm64" $(GOBUILD) -o $(BINARY_DARWIN_ARM64) -v -ldflags "-X 'main.commit=${BUILD_COMMIT}' -X 'main.date=${BUILD_DATE}' -X 'main.builtBy=make'" -build-linux: prepare +build-linux: prepare_build @echo "[*] $@" GOPATH="$(GOPATH)" \ GOOS="linux" GOARCH="amd64" $(GOBUILD) -o $(BINARY_LINUX_AMD64) -v -ldflags "-X 'main.commit=${BUILD_COMMIT}' -X 'main.date=${BUILD_DATE}' -X 'main.builtBy=make'" GOPATH="$(GOPATH)" \ GOOS="linux" GOARCH="arm64" $(GOBUILD) -o $(BINARY_LINUX_ARM64) -v -ldflags "-X 'main.commit=${BUILD_COMMIT}' -X 'main.date=${BUILD_DATE}' -X 'main.builtBy=make'" -build-pi: prepare +build-pi: prepare_build @echo "[*] $@" GOPATH="$(GOPATH)" \ GOOS="linux" GOARCH="arm" GOARM="6" $(GOBUILD) -o $(BINARY_PI) -v -ldflags "-X 'main.commit=${BUILD_COMMIT}' -X 'main.date=${BUILD_DATE}' -X 'main.builtBy=make'" -build-windows: prepare +build-windows: prepare_build @echo "[*] $@" GOPATH="$(GOPATH)" \ GOOS="windows" GOARCH="amd64" $(GOBUILD) -o $(BINARY_WINDOWS_AMD64) -v -ldflags "-X 'main.commit=${BUILD_COMMIT}' -X 'main.date=${BUILD_DATE}' -X 'main.builtBy=make'" @@ -143,14 +149,13 @@ build-windows: prepare build-all: build-mac build-linux build-pi build-windows -test: prepare +test: prepare_test @echo "[*] $@" - $(GOTEST) -v $(TESTS) + $(GOTEST) $(TESTS) -test-ci: prepare +test-ci: prepare_test @echo "[*] $@" - $(GOTEST) -v -short ./... - $(GOTEST) -v ./priority + $(GOTEST) -v -race -short -coverprofile='coverage.out' ./... coverage: @echo "[*] $@" diff --git a/build/Dockerfile b/build/Dockerfile index b1876ad2..de4d3b15 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,6 +1,8 @@ FROM alpine:latest -LABEL maintainer Fred +LABEL org.opencontainers.image.documentation="https://creativeprojects.github.io/resticprofile/" +LABEL org.opencontainers.image.source="https://github.com/creativeprojects/resticprofile" + ARG ARCH=amd64 ENV TZ=Etc/UTC diff --git a/config/mocks/NamedPropertySet.go b/config/mocks/NamedPropertySet.go new file mode 100644 index 00000000..4462f2da --- /dev/null +++ b/config/mocks/NamedPropertySet.go @@ -0,0 +1,402 @@ +// Code generated by mockery v2.42.0. DO NOT EDIT. + +package mocks + +import ( + config "github.com/creativeprojects/resticprofile/config" + mock "github.com/stretchr/testify/mock" +) + +// NamedPropertySet is an autogenerated mock type for the NamedPropertySet type +type NamedPropertySet struct { + mock.Mock +} + +type NamedPropertySet_Expecter struct { + mock *mock.Mock +} + +func (_m *NamedPropertySet) EXPECT() *NamedPropertySet_Expecter { + return &NamedPropertySet_Expecter{mock: &_m.Mock} +} + +// Description provides a mock function with given fields: +func (_m *NamedPropertySet) Description() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// NamedPropertySet_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type NamedPropertySet_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *NamedPropertySet_Expecter) Description() *NamedPropertySet_Description_Call { + return &NamedPropertySet_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *NamedPropertySet_Description_Call) Run(run func()) *NamedPropertySet_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NamedPropertySet_Description_Call) Return(_a0 string) *NamedPropertySet_Description_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NamedPropertySet_Description_Call) RunAndReturn(run func() string) *NamedPropertySet_Description_Call { + _c.Call.Return(run) + return _c +} + +// IsAllOptions provides a mock function with given fields: +func (_m *NamedPropertySet) IsAllOptions() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsAllOptions") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// NamedPropertySet_IsAllOptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAllOptions' +type NamedPropertySet_IsAllOptions_Call struct { + *mock.Call +} + +// IsAllOptions is a helper method to define mock.On call +func (_e *NamedPropertySet_Expecter) IsAllOptions() *NamedPropertySet_IsAllOptions_Call { + return &NamedPropertySet_IsAllOptions_Call{Call: _e.mock.On("IsAllOptions")} +} + +func (_c *NamedPropertySet_IsAllOptions_Call) Run(run func()) *NamedPropertySet_IsAllOptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NamedPropertySet_IsAllOptions_Call) Return(_a0 bool) *NamedPropertySet_IsAllOptions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NamedPropertySet_IsAllOptions_Call) RunAndReturn(run func() bool) *NamedPropertySet_IsAllOptions_Call { + _c.Call.Return(run) + return _c +} + +// IsClosed provides a mock function with given fields: +func (_m *NamedPropertySet) IsClosed() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsClosed") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// NamedPropertySet_IsClosed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsClosed' +type NamedPropertySet_IsClosed_Call struct { + *mock.Call +} + +// IsClosed is a helper method to define mock.On call +func (_e *NamedPropertySet_Expecter) IsClosed() *NamedPropertySet_IsClosed_Call { + return &NamedPropertySet_IsClosed_Call{Call: _e.mock.On("IsClosed")} +} + +func (_c *NamedPropertySet_IsClosed_Call) Run(run func()) *NamedPropertySet_IsClosed_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NamedPropertySet_IsClosed_Call) Return(_a0 bool) *NamedPropertySet_IsClosed_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NamedPropertySet_IsClosed_Call) RunAndReturn(run func() bool) *NamedPropertySet_IsClosed_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function with given fields: +func (_m *NamedPropertySet) Name() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// NamedPropertySet_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type NamedPropertySet_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *NamedPropertySet_Expecter) Name() *NamedPropertySet_Name_Call { + return &NamedPropertySet_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *NamedPropertySet_Name_Call) Run(run func()) *NamedPropertySet_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NamedPropertySet_Name_Call) Return(_a0 string) *NamedPropertySet_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NamedPropertySet_Name_Call) RunAndReturn(run func() string) *NamedPropertySet_Name_Call { + _c.Call.Return(run) + return _c +} + +// OtherPropertyInfo provides a mock function with given fields: +func (_m *NamedPropertySet) OtherPropertyInfo() config.PropertyInfo { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for OtherPropertyInfo") + } + + var r0 config.PropertyInfo + if rf, ok := ret.Get(0).(func() config.PropertyInfo); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.PropertyInfo) + } + } + + return r0 +} + +// NamedPropertySet_OtherPropertyInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OtherPropertyInfo' +type NamedPropertySet_OtherPropertyInfo_Call struct { + *mock.Call +} + +// OtherPropertyInfo is a helper method to define mock.On call +func (_e *NamedPropertySet_Expecter) OtherPropertyInfo() *NamedPropertySet_OtherPropertyInfo_Call { + return &NamedPropertySet_OtherPropertyInfo_Call{Call: _e.mock.On("OtherPropertyInfo")} +} + +func (_c *NamedPropertySet_OtherPropertyInfo_Call) Run(run func()) *NamedPropertySet_OtherPropertyInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NamedPropertySet_OtherPropertyInfo_Call) Return(_a0 config.PropertyInfo) *NamedPropertySet_OtherPropertyInfo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NamedPropertySet_OtherPropertyInfo_Call) RunAndReturn(run func() config.PropertyInfo) *NamedPropertySet_OtherPropertyInfo_Call { + _c.Call.Return(run) + return _c +} + +// Properties provides a mock function with given fields: +func (_m *NamedPropertySet) Properties() []string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Properties") + } + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// NamedPropertySet_Properties_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Properties' +type NamedPropertySet_Properties_Call struct { + *mock.Call +} + +// Properties is a helper method to define mock.On call +func (_e *NamedPropertySet_Expecter) Properties() *NamedPropertySet_Properties_Call { + return &NamedPropertySet_Properties_Call{Call: _e.mock.On("Properties")} +} + +func (_c *NamedPropertySet_Properties_Call) Run(run func()) *NamedPropertySet_Properties_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NamedPropertySet_Properties_Call) Return(_a0 []string) *NamedPropertySet_Properties_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NamedPropertySet_Properties_Call) RunAndReturn(run func() []string) *NamedPropertySet_Properties_Call { + _c.Call.Return(run) + return _c +} + +// PropertyInfo provides a mock function with given fields: name +func (_m *NamedPropertySet) PropertyInfo(name string) config.PropertyInfo { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for PropertyInfo") + } + + var r0 config.PropertyInfo + if rf, ok := ret.Get(0).(func(string) config.PropertyInfo); ok { + r0 = rf(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.PropertyInfo) + } + } + + return r0 +} + +// NamedPropertySet_PropertyInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PropertyInfo' +type NamedPropertySet_PropertyInfo_Call struct { + *mock.Call +} + +// PropertyInfo is a helper method to define mock.On call +// - name string +func (_e *NamedPropertySet_Expecter) PropertyInfo(name interface{}) *NamedPropertySet_PropertyInfo_Call { + return &NamedPropertySet_PropertyInfo_Call{Call: _e.mock.On("PropertyInfo", name)} +} + +func (_c *NamedPropertySet_PropertyInfo_Call) Run(run func(name string)) *NamedPropertySet_PropertyInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *NamedPropertySet_PropertyInfo_Call) Return(_a0 config.PropertyInfo) *NamedPropertySet_PropertyInfo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NamedPropertySet_PropertyInfo_Call) RunAndReturn(run func(string) config.PropertyInfo) *NamedPropertySet_PropertyInfo_Call { + _c.Call.Return(run) + return _c +} + +// TypeName provides a mock function with given fields: +func (_m *NamedPropertySet) TypeName() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for TypeName") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// NamedPropertySet_TypeName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeName' +type NamedPropertySet_TypeName_Call struct { + *mock.Call +} + +// TypeName is a helper method to define mock.On call +func (_e *NamedPropertySet_Expecter) TypeName() *NamedPropertySet_TypeName_Call { + return &NamedPropertySet_TypeName_Call{Call: _e.mock.On("TypeName")} +} + +func (_c *NamedPropertySet_TypeName_Call) Run(run func()) *NamedPropertySet_TypeName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NamedPropertySet_TypeName_Call) Return(_a0 string) *NamedPropertySet_TypeName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NamedPropertySet_TypeName_Call) RunAndReturn(run func() string) *NamedPropertySet_TypeName_Call { + _c.Call.Return(run) + return _c +} + +// NewNamedPropertySet creates a new instance of NamedPropertySet. 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 NewNamedPropertySet(t interface { + mock.TestingT + Cleanup(func()) +}) *NamedPropertySet { + mock := &NamedPropertySet{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/config/mocks/ProfileInfo.go b/config/mocks/ProfileInfo.go new file mode 100644 index 00000000..cd6669d4 --- /dev/null +++ b/config/mocks/ProfileInfo.go @@ -0,0 +1,407 @@ +// Code generated by mockery v2.42.0. DO NOT EDIT. + +package mocks + +import ( + config "github.com/creativeprojects/resticprofile/config" + mock "github.com/stretchr/testify/mock" +) + +// ProfileInfo is an autogenerated mock type for the ProfileInfo type +type ProfileInfo struct { + mock.Mock +} + +type ProfileInfo_Expecter struct { + mock *mock.Mock +} + +func (_m *ProfileInfo) EXPECT() *ProfileInfo_Expecter { + return &ProfileInfo_Expecter{mock: &_m.Mock} +} + +// IsAllOptions provides a mock function with given fields: +func (_m *ProfileInfo) IsAllOptions() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsAllOptions") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// ProfileInfo_IsAllOptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAllOptions' +type ProfileInfo_IsAllOptions_Call struct { + *mock.Call +} + +// IsAllOptions is a helper method to define mock.On call +func (_e *ProfileInfo_Expecter) IsAllOptions() *ProfileInfo_IsAllOptions_Call { + return &ProfileInfo_IsAllOptions_Call{Call: _e.mock.On("IsAllOptions")} +} + +func (_c *ProfileInfo_IsAllOptions_Call) Run(run func()) *ProfileInfo_IsAllOptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ProfileInfo_IsAllOptions_Call) Return(_a0 bool) *ProfileInfo_IsAllOptions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProfileInfo_IsAllOptions_Call) RunAndReturn(run func() bool) *ProfileInfo_IsAllOptions_Call { + _c.Call.Return(run) + return _c +} + +// IsClosed provides a mock function with given fields: +func (_m *ProfileInfo) IsClosed() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsClosed") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// ProfileInfo_IsClosed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsClosed' +type ProfileInfo_IsClosed_Call struct { + *mock.Call +} + +// IsClosed is a helper method to define mock.On call +func (_e *ProfileInfo_Expecter) IsClosed() *ProfileInfo_IsClosed_Call { + return &ProfileInfo_IsClosed_Call{Call: _e.mock.On("IsClosed")} +} + +func (_c *ProfileInfo_IsClosed_Call) Run(run func()) *ProfileInfo_IsClosed_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ProfileInfo_IsClosed_Call) Return(_a0 bool) *ProfileInfo_IsClosed_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProfileInfo_IsClosed_Call) RunAndReturn(run func() bool) *ProfileInfo_IsClosed_Call { + _c.Call.Return(run) + return _c +} + +// OtherPropertyInfo provides a mock function with given fields: +func (_m *ProfileInfo) OtherPropertyInfo() config.PropertyInfo { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for OtherPropertyInfo") + } + + var r0 config.PropertyInfo + if rf, ok := ret.Get(0).(func() config.PropertyInfo); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.PropertyInfo) + } + } + + return r0 +} + +// ProfileInfo_OtherPropertyInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OtherPropertyInfo' +type ProfileInfo_OtherPropertyInfo_Call struct { + *mock.Call +} + +// OtherPropertyInfo is a helper method to define mock.On call +func (_e *ProfileInfo_Expecter) OtherPropertyInfo() *ProfileInfo_OtherPropertyInfo_Call { + return &ProfileInfo_OtherPropertyInfo_Call{Call: _e.mock.On("OtherPropertyInfo")} +} + +func (_c *ProfileInfo_OtherPropertyInfo_Call) Run(run func()) *ProfileInfo_OtherPropertyInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ProfileInfo_OtherPropertyInfo_Call) Return(_a0 config.PropertyInfo) *ProfileInfo_OtherPropertyInfo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProfileInfo_OtherPropertyInfo_Call) RunAndReturn(run func() config.PropertyInfo) *ProfileInfo_OtherPropertyInfo_Call { + _c.Call.Return(run) + return _c +} + +// Properties provides a mock function with given fields: +func (_m *ProfileInfo) Properties() []string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Properties") + } + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// ProfileInfo_Properties_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Properties' +type ProfileInfo_Properties_Call struct { + *mock.Call +} + +// Properties is a helper method to define mock.On call +func (_e *ProfileInfo_Expecter) Properties() *ProfileInfo_Properties_Call { + return &ProfileInfo_Properties_Call{Call: _e.mock.On("Properties")} +} + +func (_c *ProfileInfo_Properties_Call) Run(run func()) *ProfileInfo_Properties_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ProfileInfo_Properties_Call) Return(_a0 []string) *ProfileInfo_Properties_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProfileInfo_Properties_Call) RunAndReturn(run func() []string) *ProfileInfo_Properties_Call { + _c.Call.Return(run) + return _c +} + +// PropertyInfo provides a mock function with given fields: name +func (_m *ProfileInfo) PropertyInfo(name string) config.PropertyInfo { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for PropertyInfo") + } + + var r0 config.PropertyInfo + if rf, ok := ret.Get(0).(func(string) config.PropertyInfo); ok { + r0 = rf(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.PropertyInfo) + } + } + + return r0 +} + +// ProfileInfo_PropertyInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PropertyInfo' +type ProfileInfo_PropertyInfo_Call struct { + *mock.Call +} + +// PropertyInfo is a helper method to define mock.On call +// - name string +func (_e *ProfileInfo_Expecter) PropertyInfo(name interface{}) *ProfileInfo_PropertyInfo_Call { + return &ProfileInfo_PropertyInfo_Call{Call: _e.mock.On("PropertyInfo", name)} +} + +func (_c *ProfileInfo_PropertyInfo_Call) Run(run func(name string)) *ProfileInfo_PropertyInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *ProfileInfo_PropertyInfo_Call) Return(_a0 config.PropertyInfo) *ProfileInfo_PropertyInfo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProfileInfo_PropertyInfo_Call) RunAndReturn(run func(string) config.PropertyInfo) *ProfileInfo_PropertyInfo_Call { + _c.Call.Return(run) + return _c +} + +// SectionInfo provides a mock function with given fields: name +func (_m *ProfileInfo) SectionInfo(name string) config.SectionInfo { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for SectionInfo") + } + + var r0 config.SectionInfo + if rf, ok := ret.Get(0).(func(string) config.SectionInfo); ok { + r0 = rf(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.SectionInfo) + } + } + + return r0 +} + +// ProfileInfo_SectionInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SectionInfo' +type ProfileInfo_SectionInfo_Call struct { + *mock.Call +} + +// SectionInfo is a helper method to define mock.On call +// - name string +func (_e *ProfileInfo_Expecter) SectionInfo(name interface{}) *ProfileInfo_SectionInfo_Call { + return &ProfileInfo_SectionInfo_Call{Call: _e.mock.On("SectionInfo", name)} +} + +func (_c *ProfileInfo_SectionInfo_Call) Run(run func(name string)) *ProfileInfo_SectionInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *ProfileInfo_SectionInfo_Call) Return(_a0 config.SectionInfo) *ProfileInfo_SectionInfo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProfileInfo_SectionInfo_Call) RunAndReturn(run func(string) config.SectionInfo) *ProfileInfo_SectionInfo_Call { + _c.Call.Return(run) + return _c +} + +// Sections provides a mock function with given fields: +func (_m *ProfileInfo) Sections() []string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Sections") + } + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// ProfileInfo_Sections_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sections' +type ProfileInfo_Sections_Call struct { + *mock.Call +} + +// Sections is a helper method to define mock.On call +func (_e *ProfileInfo_Expecter) Sections() *ProfileInfo_Sections_Call { + return &ProfileInfo_Sections_Call{Call: _e.mock.On("Sections")} +} + +func (_c *ProfileInfo_Sections_Call) Run(run func()) *ProfileInfo_Sections_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ProfileInfo_Sections_Call) Return(_a0 []string) *ProfileInfo_Sections_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProfileInfo_Sections_Call) RunAndReturn(run func() []string) *ProfileInfo_Sections_Call { + _c.Call.Return(run) + return _c +} + +// TypeName provides a mock function with given fields: +func (_m *ProfileInfo) TypeName() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for TypeName") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// ProfileInfo_TypeName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeName' +type ProfileInfo_TypeName_Call struct { + *mock.Call +} + +// TypeName is a helper method to define mock.On call +func (_e *ProfileInfo_Expecter) TypeName() *ProfileInfo_TypeName_Call { + return &ProfileInfo_TypeName_Call{Call: _e.mock.On("TypeName")} +} + +func (_c *ProfileInfo_TypeName_Call) Run(run func()) *ProfileInfo_TypeName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ProfileInfo_TypeName_Call) Return(_a0 string) *ProfileInfo_TypeName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProfileInfo_TypeName_Call) RunAndReturn(run func() string) *ProfileInfo_TypeName_Call { + _c.Call.Return(run) + return _c +} + +// NewProfileInfo creates a new instance of ProfileInfo. 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 NewProfileInfo(t interface { + mock.TestingT + Cleanup(func()) +}) *ProfileInfo { + mock := &ProfileInfo{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/config/mocks/PropertyInfo.go b/config/mocks/PropertyInfo.go new file mode 100644 index 00000000..743f168d --- /dev/null +++ b/config/mocks/PropertyInfo.go @@ -0,0 +1,1035 @@ +// Code generated by mockery v2.42.0. DO NOT EDIT. + +package mocks + +import ( + config "github.com/creativeprojects/resticprofile/config" + mock "github.com/stretchr/testify/mock" + + restic "github.com/creativeprojects/resticprofile/restic" +) + +// PropertyInfo is an autogenerated mock type for the PropertyInfo type +type PropertyInfo struct { + mock.Mock +} + +type PropertyInfo_Expecter struct { + mock *mock.Mock +} + +func (_m *PropertyInfo) EXPECT() *PropertyInfo_Expecter { + return &PropertyInfo_Expecter{mock: &_m.Mock} +} + +// CanBeBool provides a mock function with given fields: +func (_m *PropertyInfo) CanBeBool() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for CanBeBool") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_CanBeBool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanBeBool' +type PropertyInfo_CanBeBool_Call struct { + *mock.Call +} + +// CanBeBool is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) CanBeBool() *PropertyInfo_CanBeBool_Call { + return &PropertyInfo_CanBeBool_Call{Call: _e.mock.On("CanBeBool")} +} + +func (_c *PropertyInfo_CanBeBool_Call) Run(run func()) *PropertyInfo_CanBeBool_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_CanBeBool_Call) Return(_a0 bool) *PropertyInfo_CanBeBool_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_CanBeBool_Call) RunAndReturn(run func() bool) *PropertyInfo_CanBeBool_Call { + _c.Call.Return(run) + return _c +} + +// CanBeNil provides a mock function with given fields: +func (_m *PropertyInfo) CanBeNil() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for CanBeNil") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_CanBeNil_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanBeNil' +type PropertyInfo_CanBeNil_Call struct { + *mock.Call +} + +// CanBeNil is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) CanBeNil() *PropertyInfo_CanBeNil_Call { + return &PropertyInfo_CanBeNil_Call{Call: _e.mock.On("CanBeNil")} +} + +func (_c *PropertyInfo_CanBeNil_Call) Run(run func()) *PropertyInfo_CanBeNil_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_CanBeNil_Call) Return(_a0 bool) *PropertyInfo_CanBeNil_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_CanBeNil_Call) RunAndReturn(run func() bool) *PropertyInfo_CanBeNil_Call { + _c.Call.Return(run) + return _c +} + +// CanBeNumeric provides a mock function with given fields: +func (_m *PropertyInfo) CanBeNumeric() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for CanBeNumeric") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_CanBeNumeric_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanBeNumeric' +type PropertyInfo_CanBeNumeric_Call struct { + *mock.Call +} + +// CanBeNumeric is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) CanBeNumeric() *PropertyInfo_CanBeNumeric_Call { + return &PropertyInfo_CanBeNumeric_Call{Call: _e.mock.On("CanBeNumeric")} +} + +func (_c *PropertyInfo_CanBeNumeric_Call) Run(run func()) *PropertyInfo_CanBeNumeric_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_CanBeNumeric_Call) Return(_a0 bool) *PropertyInfo_CanBeNumeric_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_CanBeNumeric_Call) RunAndReturn(run func() bool) *PropertyInfo_CanBeNumeric_Call { + _c.Call.Return(run) + return _c +} + +// CanBePropertySet provides a mock function with given fields: +func (_m *PropertyInfo) CanBePropertySet() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for CanBePropertySet") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_CanBePropertySet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanBePropertySet' +type PropertyInfo_CanBePropertySet_Call struct { + *mock.Call +} + +// CanBePropertySet is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) CanBePropertySet() *PropertyInfo_CanBePropertySet_Call { + return &PropertyInfo_CanBePropertySet_Call{Call: _e.mock.On("CanBePropertySet")} +} + +func (_c *PropertyInfo_CanBePropertySet_Call) Run(run func()) *PropertyInfo_CanBePropertySet_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_CanBePropertySet_Call) Return(_a0 bool) *PropertyInfo_CanBePropertySet_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_CanBePropertySet_Call) RunAndReturn(run func() bool) *PropertyInfo_CanBePropertySet_Call { + _c.Call.Return(run) + return _c +} + +// CanBeString provides a mock function with given fields: +func (_m *PropertyInfo) CanBeString() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for CanBeString") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_CanBeString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanBeString' +type PropertyInfo_CanBeString_Call struct { + *mock.Call +} + +// CanBeString is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) CanBeString() *PropertyInfo_CanBeString_Call { + return &PropertyInfo_CanBeString_Call{Call: _e.mock.On("CanBeString")} +} + +func (_c *PropertyInfo_CanBeString_Call) Run(run func()) *PropertyInfo_CanBeString_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_CanBeString_Call) Return(_a0 bool) *PropertyInfo_CanBeString_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_CanBeString_Call) RunAndReturn(run func() bool) *PropertyInfo_CanBeString_Call { + _c.Call.Return(run) + return _c +} + +// DefaultValue provides a mock function with given fields: +func (_m *PropertyInfo) DefaultValue() []string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DefaultValue") + } + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// PropertyInfo_DefaultValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DefaultValue' +type PropertyInfo_DefaultValue_Call struct { + *mock.Call +} + +// DefaultValue is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) DefaultValue() *PropertyInfo_DefaultValue_Call { + return &PropertyInfo_DefaultValue_Call{Call: _e.mock.On("DefaultValue")} +} + +func (_c *PropertyInfo_DefaultValue_Call) Run(run func()) *PropertyInfo_DefaultValue_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_DefaultValue_Call) Return(_a0 []string) *PropertyInfo_DefaultValue_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_DefaultValue_Call) RunAndReturn(run func() []string) *PropertyInfo_DefaultValue_Call { + _c.Call.Return(run) + return _c +} + +// Description provides a mock function with given fields: +func (_m *PropertyInfo) Description() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// PropertyInfo_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type PropertyInfo_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) Description() *PropertyInfo_Description_Call { + return &PropertyInfo_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *PropertyInfo_Description_Call) Run(run func()) *PropertyInfo_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_Description_Call) Return(_a0 string) *PropertyInfo_Description_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_Description_Call) RunAndReturn(run func() string) *PropertyInfo_Description_Call { + _c.Call.Return(run) + return _c +} + +// EnumValues provides a mock function with given fields: +func (_m *PropertyInfo) EnumValues() []string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for EnumValues") + } + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// PropertyInfo_EnumValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnumValues' +type PropertyInfo_EnumValues_Call struct { + *mock.Call +} + +// EnumValues is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) EnumValues() *PropertyInfo_EnumValues_Call { + return &PropertyInfo_EnumValues_Call{Call: _e.mock.On("EnumValues")} +} + +func (_c *PropertyInfo_EnumValues_Call) Run(run func()) *PropertyInfo_EnumValues_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_EnumValues_Call) Return(_a0 []string) *PropertyInfo_EnumValues_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_EnumValues_Call) RunAndReturn(run func() []string) *PropertyInfo_EnumValues_Call { + _c.Call.Return(run) + return _c +} + +// ExampleValues provides a mock function with given fields: +func (_m *PropertyInfo) ExampleValues() []string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ExampleValues") + } + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// PropertyInfo_ExampleValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExampleValues' +type PropertyInfo_ExampleValues_Call struct { + *mock.Call +} + +// ExampleValues is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) ExampleValues() *PropertyInfo_ExampleValues_Call { + return &PropertyInfo_ExampleValues_Call{Call: _e.mock.On("ExampleValues")} +} + +func (_c *PropertyInfo_ExampleValues_Call) Run(run func()) *PropertyInfo_ExampleValues_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_ExampleValues_Call) Return(_a0 []string) *PropertyInfo_ExampleValues_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_ExampleValues_Call) RunAndReturn(run func() []string) *PropertyInfo_ExampleValues_Call { + _c.Call.Return(run) + return _c +} + +// Format provides a mock function with given fields: +func (_m *PropertyInfo) Format() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Format") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// PropertyInfo_Format_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Format' +type PropertyInfo_Format_Call struct { + *mock.Call +} + +// Format is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) Format() *PropertyInfo_Format_Call { + return &PropertyInfo_Format_Call{Call: _e.mock.On("Format")} +} + +func (_c *PropertyInfo_Format_Call) Run(run func()) *PropertyInfo_Format_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_Format_Call) Return(_a0 string) *PropertyInfo_Format_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_Format_Call) RunAndReturn(run func() string) *PropertyInfo_Format_Call { + _c.Call.Return(run) + return _c +} + +// IsAnyType provides a mock function with given fields: +func (_m *PropertyInfo) IsAnyType() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsAnyType") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_IsAnyType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAnyType' +type PropertyInfo_IsAnyType_Call struct { + *mock.Call +} + +// IsAnyType is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) IsAnyType() *PropertyInfo_IsAnyType_Call { + return &PropertyInfo_IsAnyType_Call{Call: _e.mock.On("IsAnyType")} +} + +func (_c *PropertyInfo_IsAnyType_Call) Run(run func()) *PropertyInfo_IsAnyType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_IsAnyType_Call) Return(_a0 bool) *PropertyInfo_IsAnyType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_IsAnyType_Call) RunAndReturn(run func() bool) *PropertyInfo_IsAnyType_Call { + _c.Call.Return(run) + return _c +} + +// IsDeprecated provides a mock function with given fields: +func (_m *PropertyInfo) IsDeprecated() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsDeprecated") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_IsDeprecated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsDeprecated' +type PropertyInfo_IsDeprecated_Call struct { + *mock.Call +} + +// IsDeprecated is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) IsDeprecated() *PropertyInfo_IsDeprecated_Call { + return &PropertyInfo_IsDeprecated_Call{Call: _e.mock.On("IsDeprecated")} +} + +func (_c *PropertyInfo_IsDeprecated_Call) Run(run func()) *PropertyInfo_IsDeprecated_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_IsDeprecated_Call) Return(_a0 bool) *PropertyInfo_IsDeprecated_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_IsDeprecated_Call) RunAndReturn(run func() bool) *PropertyInfo_IsDeprecated_Call { + _c.Call.Return(run) + return _c +} + +// IsMultiType provides a mock function with given fields: +func (_m *PropertyInfo) IsMultiType() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsMultiType") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_IsMultiType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsMultiType' +type PropertyInfo_IsMultiType_Call struct { + *mock.Call +} + +// IsMultiType is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) IsMultiType() *PropertyInfo_IsMultiType_Call { + return &PropertyInfo_IsMultiType_Call{Call: _e.mock.On("IsMultiType")} +} + +func (_c *PropertyInfo_IsMultiType_Call) Run(run func()) *PropertyInfo_IsMultiType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_IsMultiType_Call) Return(_a0 bool) *PropertyInfo_IsMultiType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_IsMultiType_Call) RunAndReturn(run func() bool) *PropertyInfo_IsMultiType_Call { + _c.Call.Return(run) + return _c +} + +// IsOption provides a mock function with given fields: +func (_m *PropertyInfo) IsOption() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsOption") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_IsOption_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsOption' +type PropertyInfo_IsOption_Call struct { + *mock.Call +} + +// IsOption is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) IsOption() *PropertyInfo_IsOption_Call { + return &PropertyInfo_IsOption_Call{Call: _e.mock.On("IsOption")} +} + +func (_c *PropertyInfo_IsOption_Call) Run(run func()) *PropertyInfo_IsOption_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_IsOption_Call) Return(_a0 bool) *PropertyInfo_IsOption_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_IsOption_Call) RunAndReturn(run func() bool) *PropertyInfo_IsOption_Call { + _c.Call.Return(run) + return _c +} + +// IsRequired provides a mock function with given fields: +func (_m *PropertyInfo) IsRequired() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsRequired") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_IsRequired_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsRequired' +type PropertyInfo_IsRequired_Call struct { + *mock.Call +} + +// IsRequired is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) IsRequired() *PropertyInfo_IsRequired_Call { + return &PropertyInfo_IsRequired_Call{Call: _e.mock.On("IsRequired")} +} + +func (_c *PropertyInfo_IsRequired_Call) Run(run func()) *PropertyInfo_IsRequired_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_IsRequired_Call) Return(_a0 bool) *PropertyInfo_IsRequired_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_IsRequired_Call) RunAndReturn(run func() bool) *PropertyInfo_IsRequired_Call { + _c.Call.Return(run) + return _c +} + +// IsSingle provides a mock function with given fields: +func (_m *PropertyInfo) IsSingle() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsSingle") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_IsSingle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSingle' +type PropertyInfo_IsSingle_Call struct { + *mock.Call +} + +// IsSingle is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) IsSingle() *PropertyInfo_IsSingle_Call { + return &PropertyInfo_IsSingle_Call{Call: _e.mock.On("IsSingle")} +} + +func (_c *PropertyInfo_IsSingle_Call) Run(run func()) *PropertyInfo_IsSingle_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_IsSingle_Call) Return(_a0 bool) *PropertyInfo_IsSingle_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_IsSingle_Call) RunAndReturn(run func() bool) *PropertyInfo_IsSingle_Call { + _c.Call.Return(run) + return _c +} + +// MustBeInteger provides a mock function with given fields: +func (_m *PropertyInfo) MustBeInteger() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MustBeInteger") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// PropertyInfo_MustBeInteger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MustBeInteger' +type PropertyInfo_MustBeInteger_Call struct { + *mock.Call +} + +// MustBeInteger is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) MustBeInteger() *PropertyInfo_MustBeInteger_Call { + return &PropertyInfo_MustBeInteger_Call{Call: _e.mock.On("MustBeInteger")} +} + +func (_c *PropertyInfo_MustBeInteger_Call) Run(run func()) *PropertyInfo_MustBeInteger_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_MustBeInteger_Call) Return(_a0 bool) *PropertyInfo_MustBeInteger_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_MustBeInteger_Call) RunAndReturn(run func() bool) *PropertyInfo_MustBeInteger_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function with given fields: +func (_m *PropertyInfo) Name() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// PropertyInfo_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type PropertyInfo_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) Name() *PropertyInfo_Name_Call { + return &PropertyInfo_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *PropertyInfo_Name_Call) Run(run func()) *PropertyInfo_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_Name_Call) Return(_a0 string) *PropertyInfo_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_Name_Call) RunAndReturn(run func() string) *PropertyInfo_Name_Call { + _c.Call.Return(run) + return _c +} + +// NumericRange provides a mock function with given fields: +func (_m *PropertyInfo) NumericRange() config.NumericRange { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NumericRange") + } + + var r0 config.NumericRange + if rf, ok := ret.Get(0).(func() config.NumericRange); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(config.NumericRange) + } + + return r0 +} + +// PropertyInfo_NumericRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NumericRange' +type PropertyInfo_NumericRange_Call struct { + *mock.Call +} + +// NumericRange is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) NumericRange() *PropertyInfo_NumericRange_Call { + return &PropertyInfo_NumericRange_Call{Call: _e.mock.On("NumericRange")} +} + +func (_c *PropertyInfo_NumericRange_Call) Run(run func()) *PropertyInfo_NumericRange_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_NumericRange_Call) Return(_a0 config.NumericRange) *PropertyInfo_NumericRange_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_NumericRange_Call) RunAndReturn(run func() config.NumericRange) *PropertyInfo_NumericRange_Call { + _c.Call.Return(run) + return _c +} + +// Option provides a mock function with given fields: +func (_m *PropertyInfo) Option() restic.Option { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Option") + } + + var r0 restic.Option + if rf, ok := ret.Get(0).(func() restic.Option); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(restic.Option) + } + + return r0 +} + +// PropertyInfo_Option_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Option' +type PropertyInfo_Option_Call struct { + *mock.Call +} + +// Option is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) Option() *PropertyInfo_Option_Call { + return &PropertyInfo_Option_Call{Call: _e.mock.On("Option")} +} + +func (_c *PropertyInfo_Option_Call) Run(run func()) *PropertyInfo_Option_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_Option_Call) Return(_a0 restic.Option) *PropertyInfo_Option_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_Option_Call) RunAndReturn(run func() restic.Option) *PropertyInfo_Option_Call { + _c.Call.Return(run) + return _c +} + +// PropertySet provides a mock function with given fields: +func (_m *PropertyInfo) PropertySet() config.NamedPropertySet { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for PropertySet") + } + + var r0 config.NamedPropertySet + if rf, ok := ret.Get(0).(func() config.NamedPropertySet); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.NamedPropertySet) + } + } + + return r0 +} + +// PropertyInfo_PropertySet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PropertySet' +type PropertyInfo_PropertySet_Call struct { + *mock.Call +} + +// PropertySet is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) PropertySet() *PropertyInfo_PropertySet_Call { + return &PropertyInfo_PropertySet_Call{Call: _e.mock.On("PropertySet")} +} + +func (_c *PropertyInfo_PropertySet_Call) Run(run func()) *PropertyInfo_PropertySet_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_PropertySet_Call) Return(_a0 config.NamedPropertySet) *PropertyInfo_PropertySet_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_PropertySet_Call) RunAndReturn(run func() config.NamedPropertySet) *PropertyInfo_PropertySet_Call { + _c.Call.Return(run) + return _c +} + +// ValidationPattern provides a mock function with given fields: +func (_m *PropertyInfo) ValidationPattern() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ValidationPattern") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// PropertyInfo_ValidationPattern_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidationPattern' +type PropertyInfo_ValidationPattern_Call struct { + *mock.Call +} + +// ValidationPattern is a helper method to define mock.On call +func (_e *PropertyInfo_Expecter) ValidationPattern() *PropertyInfo_ValidationPattern_Call { + return &PropertyInfo_ValidationPattern_Call{Call: _e.mock.On("ValidationPattern")} +} + +func (_c *PropertyInfo_ValidationPattern_Call) Run(run func()) *PropertyInfo_ValidationPattern_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PropertyInfo_ValidationPattern_Call) Return(_a0 string) *PropertyInfo_ValidationPattern_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PropertyInfo_ValidationPattern_Call) RunAndReturn(run func() string) *PropertyInfo_ValidationPattern_Call { + _c.Call.Return(run) + return _c +} + +// NewPropertyInfo creates a new instance of PropertyInfo. 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 NewPropertyInfo(t interface { + mock.TestingT + Cleanup(func()) +}) *PropertyInfo { + mock := &PropertyInfo{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/config/mocks/SectionInfo.go b/config/mocks/SectionInfo.go new file mode 100644 index 00000000..537019a3 --- /dev/null +++ b/config/mocks/SectionInfo.go @@ -0,0 +1,496 @@ +// Code generated by mockery v2.42.0. DO NOT EDIT. + +package mocks + +import ( + config "github.com/creativeprojects/resticprofile/config" + mock "github.com/stretchr/testify/mock" + + restic "github.com/creativeprojects/resticprofile/restic" +) + +// SectionInfo is an autogenerated mock type for the SectionInfo type +type SectionInfo struct { + mock.Mock +} + +type SectionInfo_Expecter struct { + mock *mock.Mock +} + +func (_m *SectionInfo) EXPECT() *SectionInfo_Expecter { + return &SectionInfo_Expecter{mock: &_m.Mock} +} + +// Command provides a mock function with given fields: +func (_m *SectionInfo) Command() restic.CommandIf { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Command") + } + + var r0 restic.CommandIf + if rf, ok := ret.Get(0).(func() restic.CommandIf); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(restic.CommandIf) + } + } + + return r0 +} + +// SectionInfo_Command_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Command' +type SectionInfo_Command_Call struct { + *mock.Call +} + +// Command is a helper method to define mock.On call +func (_e *SectionInfo_Expecter) Command() *SectionInfo_Command_Call { + return &SectionInfo_Command_Call{Call: _e.mock.On("Command")} +} + +func (_c *SectionInfo_Command_Call) Run(run func()) *SectionInfo_Command_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SectionInfo_Command_Call) Return(_a0 restic.CommandIf) *SectionInfo_Command_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SectionInfo_Command_Call) RunAndReturn(run func() restic.CommandIf) *SectionInfo_Command_Call { + _c.Call.Return(run) + return _c +} + +// Description provides a mock function with given fields: +func (_m *SectionInfo) Description() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// SectionInfo_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type SectionInfo_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *SectionInfo_Expecter) Description() *SectionInfo_Description_Call { + return &SectionInfo_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *SectionInfo_Description_Call) Run(run func()) *SectionInfo_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SectionInfo_Description_Call) Return(_a0 string) *SectionInfo_Description_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SectionInfo_Description_Call) RunAndReturn(run func() string) *SectionInfo_Description_Call { + _c.Call.Return(run) + return _c +} + +// IsAllOptions provides a mock function with given fields: +func (_m *SectionInfo) IsAllOptions() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsAllOptions") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// SectionInfo_IsAllOptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAllOptions' +type SectionInfo_IsAllOptions_Call struct { + *mock.Call +} + +// IsAllOptions is a helper method to define mock.On call +func (_e *SectionInfo_Expecter) IsAllOptions() *SectionInfo_IsAllOptions_Call { + return &SectionInfo_IsAllOptions_Call{Call: _e.mock.On("IsAllOptions")} +} + +func (_c *SectionInfo_IsAllOptions_Call) Run(run func()) *SectionInfo_IsAllOptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SectionInfo_IsAllOptions_Call) Return(_a0 bool) *SectionInfo_IsAllOptions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SectionInfo_IsAllOptions_Call) RunAndReturn(run func() bool) *SectionInfo_IsAllOptions_Call { + _c.Call.Return(run) + return _c +} + +// IsClosed provides a mock function with given fields: +func (_m *SectionInfo) IsClosed() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsClosed") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// SectionInfo_IsClosed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsClosed' +type SectionInfo_IsClosed_Call struct { + *mock.Call +} + +// IsClosed is a helper method to define mock.On call +func (_e *SectionInfo_Expecter) IsClosed() *SectionInfo_IsClosed_Call { + return &SectionInfo_IsClosed_Call{Call: _e.mock.On("IsClosed")} +} + +func (_c *SectionInfo_IsClosed_Call) Run(run func()) *SectionInfo_IsClosed_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SectionInfo_IsClosed_Call) Return(_a0 bool) *SectionInfo_IsClosed_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SectionInfo_IsClosed_Call) RunAndReturn(run func() bool) *SectionInfo_IsClosed_Call { + _c.Call.Return(run) + return _c +} + +// IsCommandSection provides a mock function with given fields: +func (_m *SectionInfo) IsCommandSection() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsCommandSection") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// SectionInfo_IsCommandSection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsCommandSection' +type SectionInfo_IsCommandSection_Call struct { + *mock.Call +} + +// IsCommandSection is a helper method to define mock.On call +func (_e *SectionInfo_Expecter) IsCommandSection() *SectionInfo_IsCommandSection_Call { + return &SectionInfo_IsCommandSection_Call{Call: _e.mock.On("IsCommandSection")} +} + +func (_c *SectionInfo_IsCommandSection_Call) Run(run func()) *SectionInfo_IsCommandSection_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SectionInfo_IsCommandSection_Call) Return(_a0 bool) *SectionInfo_IsCommandSection_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SectionInfo_IsCommandSection_Call) RunAndReturn(run func() bool) *SectionInfo_IsCommandSection_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function with given fields: +func (_m *SectionInfo) Name() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// SectionInfo_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type SectionInfo_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *SectionInfo_Expecter) Name() *SectionInfo_Name_Call { + return &SectionInfo_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *SectionInfo_Name_Call) Run(run func()) *SectionInfo_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SectionInfo_Name_Call) Return(_a0 string) *SectionInfo_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SectionInfo_Name_Call) RunAndReturn(run func() string) *SectionInfo_Name_Call { + _c.Call.Return(run) + return _c +} + +// OtherPropertyInfo provides a mock function with given fields: +func (_m *SectionInfo) OtherPropertyInfo() config.PropertyInfo { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for OtherPropertyInfo") + } + + var r0 config.PropertyInfo + if rf, ok := ret.Get(0).(func() config.PropertyInfo); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.PropertyInfo) + } + } + + return r0 +} + +// SectionInfo_OtherPropertyInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OtherPropertyInfo' +type SectionInfo_OtherPropertyInfo_Call struct { + *mock.Call +} + +// OtherPropertyInfo is a helper method to define mock.On call +func (_e *SectionInfo_Expecter) OtherPropertyInfo() *SectionInfo_OtherPropertyInfo_Call { + return &SectionInfo_OtherPropertyInfo_Call{Call: _e.mock.On("OtherPropertyInfo")} +} + +func (_c *SectionInfo_OtherPropertyInfo_Call) Run(run func()) *SectionInfo_OtherPropertyInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SectionInfo_OtherPropertyInfo_Call) Return(_a0 config.PropertyInfo) *SectionInfo_OtherPropertyInfo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SectionInfo_OtherPropertyInfo_Call) RunAndReturn(run func() config.PropertyInfo) *SectionInfo_OtherPropertyInfo_Call { + _c.Call.Return(run) + return _c +} + +// Properties provides a mock function with given fields: +func (_m *SectionInfo) Properties() []string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Properties") + } + + var r0 []string + if rf, ok := ret.Get(0).(func() []string); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + return r0 +} + +// SectionInfo_Properties_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Properties' +type SectionInfo_Properties_Call struct { + *mock.Call +} + +// Properties is a helper method to define mock.On call +func (_e *SectionInfo_Expecter) Properties() *SectionInfo_Properties_Call { + return &SectionInfo_Properties_Call{Call: _e.mock.On("Properties")} +} + +func (_c *SectionInfo_Properties_Call) Run(run func()) *SectionInfo_Properties_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SectionInfo_Properties_Call) Return(_a0 []string) *SectionInfo_Properties_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SectionInfo_Properties_Call) RunAndReturn(run func() []string) *SectionInfo_Properties_Call { + _c.Call.Return(run) + return _c +} + +// PropertyInfo provides a mock function with given fields: name +func (_m *SectionInfo) PropertyInfo(name string) config.PropertyInfo { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for PropertyInfo") + } + + var r0 config.PropertyInfo + if rf, ok := ret.Get(0).(func(string) config.PropertyInfo); ok { + r0 = rf(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.PropertyInfo) + } + } + + return r0 +} + +// SectionInfo_PropertyInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PropertyInfo' +type SectionInfo_PropertyInfo_Call struct { + *mock.Call +} + +// PropertyInfo is a helper method to define mock.On call +// - name string +func (_e *SectionInfo_Expecter) PropertyInfo(name interface{}) *SectionInfo_PropertyInfo_Call { + return &SectionInfo_PropertyInfo_Call{Call: _e.mock.On("PropertyInfo", name)} +} + +func (_c *SectionInfo_PropertyInfo_Call) Run(run func(name string)) *SectionInfo_PropertyInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *SectionInfo_PropertyInfo_Call) Return(_a0 config.PropertyInfo) *SectionInfo_PropertyInfo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SectionInfo_PropertyInfo_Call) RunAndReturn(run func(string) config.PropertyInfo) *SectionInfo_PropertyInfo_Call { + _c.Call.Return(run) + return _c +} + +// TypeName provides a mock function with given fields: +func (_m *SectionInfo) TypeName() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for TypeName") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// SectionInfo_TypeName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TypeName' +type SectionInfo_TypeName_Call struct { + *mock.Call +} + +// TypeName is a helper method to define mock.On call +func (_e *SectionInfo_Expecter) TypeName() *SectionInfo_TypeName_Call { + return &SectionInfo_TypeName_Call{Call: _e.mock.On("TypeName")} +} + +func (_c *SectionInfo_TypeName_Call) Run(run func()) *SectionInfo_TypeName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SectionInfo_TypeName_Call) Return(_a0 string) *SectionInfo_TypeName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SectionInfo_TypeName_Call) RunAndReturn(run func() string) *SectionInfo_TypeName_Call { + _c.Call.Return(run) + return _c +} + +// NewSectionInfo creates a new instance of SectionInfo. 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 NewSectionInfo(t interface { + mock.TestingT + Cleanup(func()) +}) *SectionInfo { + mock := &SectionInfo{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generate.go b/generate.go deleted file mode 100644 index 7398dc42..00000000 --- a/generate.go +++ /dev/null @@ -1,5 +0,0 @@ -package main - -//go:generate go install -v github.com/zyedidia/eget@latest -//go:generate "${GOPATH}/bin/eget" vektra/mockery --upgrade-only --to "${GOPATH}/bin" -//go:generate "${GOPATH}/bin/mockery" --config .mockery.yaml diff --git a/install.sh b/install.sh index 126d139c..f932ef74 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/sh set -e -# Code generated by godownloader on 2023-03-24T19:56:48Z. DO NOT EDIT. +# Code generated by godownloader on 2024-02-19T20:50:33Z. DO NOT EDIT. # usage() { @@ -64,8 +64,6 @@ get_binaries() { case "$PLATFORM" in darwin/amd64) BINARIES="resticprofile resticprofile" ;; darwin/arm64) BINARIES="resticprofile resticprofile" ;; - darwin/armv6) BINARIES="resticprofile" ;; - darwin/armv7) BINARIES="resticprofile" ;; freebsd/386) BINARIES="resticprofile" ;; freebsd/amd64) BINARIES="resticprofile" ;; freebsd/armv6) BINARIES="resticprofile" ;; @@ -75,11 +73,21 @@ get_binaries() { linux/arm64) BINARIES="resticprofile" ;; linux/armv6) BINARIES="resticprofile" ;; linux/armv7) BINARIES="resticprofile" ;; + linux/mips) BINARIES="resticprofile" ;; + linux/mips64) BINARIES="resticprofile" ;; + linux/mips64le) BINARIES="resticprofile" ;; + linux/mipsle) BINARIES="resticprofile" ;; + linux/ppc64) BINARIES="resticprofile" ;; + linux/ppc64le) BINARIES="resticprofile" ;; + linux/riscv64) BINARIES="resticprofile" ;; + linux/s390x) BINARIES="resticprofile" ;; + netbsd/amd64) BINARIES="resticprofile" ;; + openbsd/386) BINARIES="resticprofile" ;; + openbsd/amd64) BINARIES="resticprofile" ;; + solaris/amd64) BINARIES="resticprofile" ;; windows/386) BINARIES="resticprofile resticprofile" ;; windows/amd64) BINARIES="resticprofile resticprofile" ;; windows/arm64) BINARIES="resticprofile" ;; - windows/armv6) BINARIES="resticprofile" ;; - windows/armv7) BINARIES="resticprofile" ;; *) log_crit "platform $PLATFORM is not supported. Make sure this script is up-to-date and file request at https://github.com/${PREFIX}/issues/new" exit 1 diff --git a/monitor/mocks/OutputAnalysis.go b/monitor/mocks/OutputAnalysis.go new file mode 100644 index 00000000..20ba9538 --- /dev/null +++ b/monitor/mocks/OutputAnalysis.go @@ -0,0 +1,246 @@ +// Code generated by mockery v2.42.0. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + + time "time" +) + +// OutputAnalysis is an autogenerated mock type for the OutputAnalysis type +type OutputAnalysis struct { + mock.Mock +} + +type OutputAnalysis_Expecter struct { + mock *mock.Mock +} + +func (_m *OutputAnalysis) EXPECT() *OutputAnalysis_Expecter { + return &OutputAnalysis_Expecter{mock: &_m.Mock} +} + +// ContainsRemoteLockFailure provides a mock function with given fields: +func (_m *OutputAnalysis) ContainsRemoteLockFailure() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ContainsRemoteLockFailure") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// OutputAnalysis_ContainsRemoteLockFailure_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ContainsRemoteLockFailure' +type OutputAnalysis_ContainsRemoteLockFailure_Call struct { + *mock.Call +} + +// ContainsRemoteLockFailure is a helper method to define mock.On call +func (_e *OutputAnalysis_Expecter) ContainsRemoteLockFailure() *OutputAnalysis_ContainsRemoteLockFailure_Call { + return &OutputAnalysis_ContainsRemoteLockFailure_Call{Call: _e.mock.On("ContainsRemoteLockFailure")} +} + +func (_c *OutputAnalysis_ContainsRemoteLockFailure_Call) Run(run func()) *OutputAnalysis_ContainsRemoteLockFailure_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OutputAnalysis_ContainsRemoteLockFailure_Call) Return(_a0 bool) *OutputAnalysis_ContainsRemoteLockFailure_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OutputAnalysis_ContainsRemoteLockFailure_Call) RunAndReturn(run func() bool) *OutputAnalysis_ContainsRemoteLockFailure_Call { + _c.Call.Return(run) + return _c +} + +// GetRemoteLockedBy provides a mock function with given fields: +func (_m *OutputAnalysis) GetRemoteLockedBy() (string, bool) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRemoteLockedBy") + } + + var r0 string + var r1 bool + if rf, ok := ret.Get(0).(func() (string, bool)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() bool); ok { + r1 = rf() + } else { + r1 = ret.Get(1).(bool) + } + + return r0, r1 +} + +// OutputAnalysis_GetRemoteLockedBy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRemoteLockedBy' +type OutputAnalysis_GetRemoteLockedBy_Call struct { + *mock.Call +} + +// GetRemoteLockedBy is a helper method to define mock.On call +func (_e *OutputAnalysis_Expecter) GetRemoteLockedBy() *OutputAnalysis_GetRemoteLockedBy_Call { + return &OutputAnalysis_GetRemoteLockedBy_Call{Call: _e.mock.On("GetRemoteLockedBy")} +} + +func (_c *OutputAnalysis_GetRemoteLockedBy_Call) Run(run func()) *OutputAnalysis_GetRemoteLockedBy_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OutputAnalysis_GetRemoteLockedBy_Call) Return(_a0 string, _a1 bool) *OutputAnalysis_GetRemoteLockedBy_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OutputAnalysis_GetRemoteLockedBy_Call) RunAndReturn(run func() (string, bool)) *OutputAnalysis_GetRemoteLockedBy_Call { + _c.Call.Return(run) + return _c +} + +// GetRemoteLockedMaxWait provides a mock function with given fields: +func (_m *OutputAnalysis) GetRemoteLockedMaxWait() (time.Duration, bool) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRemoteLockedMaxWait") + } + + var r0 time.Duration + var r1 bool + if rf, ok := ret.Get(0).(func() (time.Duration, bool)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Duration) + } + + if rf, ok := ret.Get(1).(func() bool); ok { + r1 = rf() + } else { + r1 = ret.Get(1).(bool) + } + + return r0, r1 +} + +// OutputAnalysis_GetRemoteLockedMaxWait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRemoteLockedMaxWait' +type OutputAnalysis_GetRemoteLockedMaxWait_Call struct { + *mock.Call +} + +// GetRemoteLockedMaxWait is a helper method to define mock.On call +func (_e *OutputAnalysis_Expecter) GetRemoteLockedMaxWait() *OutputAnalysis_GetRemoteLockedMaxWait_Call { + return &OutputAnalysis_GetRemoteLockedMaxWait_Call{Call: _e.mock.On("GetRemoteLockedMaxWait")} +} + +func (_c *OutputAnalysis_GetRemoteLockedMaxWait_Call) Run(run func()) *OutputAnalysis_GetRemoteLockedMaxWait_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OutputAnalysis_GetRemoteLockedMaxWait_Call) Return(_a0 time.Duration, _a1 bool) *OutputAnalysis_GetRemoteLockedMaxWait_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OutputAnalysis_GetRemoteLockedMaxWait_Call) RunAndReturn(run func() (time.Duration, bool)) *OutputAnalysis_GetRemoteLockedMaxWait_Call { + _c.Call.Return(run) + return _c +} + +// GetRemoteLockedSince provides a mock function with given fields: +func (_m *OutputAnalysis) GetRemoteLockedSince() (time.Duration, bool) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRemoteLockedSince") + } + + var r0 time.Duration + var r1 bool + if rf, ok := ret.Get(0).(func() (time.Duration, bool)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Duration) + } + + if rf, ok := ret.Get(1).(func() bool); ok { + r1 = rf() + } else { + r1 = ret.Get(1).(bool) + } + + return r0, r1 +} + +// OutputAnalysis_GetRemoteLockedSince_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRemoteLockedSince' +type OutputAnalysis_GetRemoteLockedSince_Call struct { + *mock.Call +} + +// GetRemoteLockedSince is a helper method to define mock.On call +func (_e *OutputAnalysis_Expecter) GetRemoteLockedSince() *OutputAnalysis_GetRemoteLockedSince_Call { + return &OutputAnalysis_GetRemoteLockedSince_Call{Call: _e.mock.On("GetRemoteLockedSince")} +} + +func (_c *OutputAnalysis_GetRemoteLockedSince_Call) Run(run func()) *OutputAnalysis_GetRemoteLockedSince_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OutputAnalysis_GetRemoteLockedSince_Call) Return(_a0 time.Duration, _a1 bool) *OutputAnalysis_GetRemoteLockedSince_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *OutputAnalysis_GetRemoteLockedSince_Call) RunAndReturn(run func() (time.Duration, bool)) *OutputAnalysis_GetRemoteLockedSince_Call { + _c.Call.Return(run) + return _c +} + +// NewOutputAnalysis creates a new instance of OutputAnalysis. 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 NewOutputAnalysis(t interface { + mock.TestingT + Cleanup(func()) +}) *OutputAnalysis { + mock := &OutputAnalysis{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/schedule/mocks/Handler.go b/schedule/mocks/Handler.go new file mode 100644 index 00000000..c85d79c2 --- /dev/null +++ b/schedule/mocks/Handler.go @@ -0,0 +1,440 @@ +// Code generated by mockery v2.42.0. DO NOT EDIT. + +package mocks + +import ( + calendar "github.com/creativeprojects/resticprofile/calendar" + config "github.com/creativeprojects/resticprofile/config" + + mock "github.com/stretchr/testify/mock" +) + +// Handler is an autogenerated mock type for the Handler type +type Handler struct { + mock.Mock +} + +type Handler_Expecter struct { + mock *mock.Mock +} + +func (_m *Handler) EXPECT() *Handler_Expecter { + return &Handler_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *Handler) Close() { + _m.Called() +} + +// Handler_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Handler_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Handler_Expecter) Close() *Handler_Close_Call { + return &Handler_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Handler_Close_Call) Run(run func()) *Handler_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Handler_Close_Call) Return() *Handler_Close_Call { + _c.Call.Return() + return _c +} + +func (_c *Handler_Close_Call) RunAndReturn(run func()) *Handler_Close_Call { + _c.Call.Return(run) + return _c +} + +// CreateJob provides a mock function with given fields: job, schedules, permission +func (_m *Handler) CreateJob(job *config.ScheduleConfig, schedules []*calendar.Event, permission string) error { + ret := _m.Called(job, schedules, permission) + + if len(ret) == 0 { + panic("no return value specified for CreateJob") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*config.ScheduleConfig, []*calendar.Event, string) error); ok { + r0 = rf(job, schedules, permission) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Handler_CreateJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateJob' +type Handler_CreateJob_Call struct { + *mock.Call +} + +// CreateJob is a helper method to define mock.On call +// - job *config.ScheduleConfig +// - schedules []*calendar.Event +// - permission string +func (_e *Handler_Expecter) CreateJob(job interface{}, schedules interface{}, permission interface{}) *Handler_CreateJob_Call { + return &Handler_CreateJob_Call{Call: _e.mock.On("CreateJob", job, schedules, permission)} +} + +func (_c *Handler_CreateJob_Call) Run(run func(job *config.ScheduleConfig, schedules []*calendar.Event, permission string)) *Handler_CreateJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*config.ScheduleConfig), args[1].([]*calendar.Event), args[2].(string)) + }) + return _c +} + +func (_c *Handler_CreateJob_Call) Return(_a0 error) *Handler_CreateJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Handler_CreateJob_Call) RunAndReturn(run func(*config.ScheduleConfig, []*calendar.Event, string) error) *Handler_CreateJob_Call { + _c.Call.Return(run) + return _c +} + +// DisplayJobStatus provides a mock function with given fields: job +func (_m *Handler) DisplayJobStatus(job *config.ScheduleConfig) error { + ret := _m.Called(job) + + if len(ret) == 0 { + panic("no return value specified for DisplayJobStatus") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*config.ScheduleConfig) error); ok { + r0 = rf(job) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Handler_DisplayJobStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisplayJobStatus' +type Handler_DisplayJobStatus_Call struct { + *mock.Call +} + +// DisplayJobStatus is a helper method to define mock.On call +// - job *config.ScheduleConfig +func (_e *Handler_Expecter) DisplayJobStatus(job interface{}) *Handler_DisplayJobStatus_Call { + return &Handler_DisplayJobStatus_Call{Call: _e.mock.On("DisplayJobStatus", job)} +} + +func (_c *Handler_DisplayJobStatus_Call) Run(run func(job *config.ScheduleConfig)) *Handler_DisplayJobStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*config.ScheduleConfig)) + }) + return _c +} + +func (_c *Handler_DisplayJobStatus_Call) Return(_a0 error) *Handler_DisplayJobStatus_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Handler_DisplayJobStatus_Call) RunAndReturn(run func(*config.ScheduleConfig) error) *Handler_DisplayJobStatus_Call { + _c.Call.Return(run) + return _c +} + +// DisplayParsedSchedules provides a mock function with given fields: command, events +func (_m *Handler) DisplayParsedSchedules(command string, events []*calendar.Event) { + _m.Called(command, events) +} + +// Handler_DisplayParsedSchedules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisplayParsedSchedules' +type Handler_DisplayParsedSchedules_Call struct { + *mock.Call +} + +// DisplayParsedSchedules is a helper method to define mock.On call +// - command string +// - events []*calendar.Event +func (_e *Handler_Expecter) DisplayParsedSchedules(command interface{}, events interface{}) *Handler_DisplayParsedSchedules_Call { + return &Handler_DisplayParsedSchedules_Call{Call: _e.mock.On("DisplayParsedSchedules", command, events)} +} + +func (_c *Handler_DisplayParsedSchedules_Call) Run(run func(command string, events []*calendar.Event)) *Handler_DisplayParsedSchedules_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]*calendar.Event)) + }) + return _c +} + +func (_c *Handler_DisplayParsedSchedules_Call) Return() *Handler_DisplayParsedSchedules_Call { + _c.Call.Return() + return _c +} + +func (_c *Handler_DisplayParsedSchedules_Call) RunAndReturn(run func(string, []*calendar.Event)) *Handler_DisplayParsedSchedules_Call { + _c.Call.Return(run) + return _c +} + +// DisplaySchedules provides a mock function with given fields: command, schedules +func (_m *Handler) DisplaySchedules(command string, schedules []string) error { + ret := _m.Called(command, schedules) + + if len(ret) == 0 { + panic("no return value specified for DisplaySchedules") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, []string) error); ok { + r0 = rf(command, schedules) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Handler_DisplaySchedules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisplaySchedules' +type Handler_DisplaySchedules_Call struct { + *mock.Call +} + +// DisplaySchedules is a helper method to define mock.On call +// - command string +// - schedules []string +func (_e *Handler_Expecter) DisplaySchedules(command interface{}, schedules interface{}) *Handler_DisplaySchedules_Call { + return &Handler_DisplaySchedules_Call{Call: _e.mock.On("DisplaySchedules", command, schedules)} +} + +func (_c *Handler_DisplaySchedules_Call) Run(run func(command string, schedules []string)) *Handler_DisplaySchedules_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].([]string)) + }) + return _c +} + +func (_c *Handler_DisplaySchedules_Call) Return(_a0 error) *Handler_DisplaySchedules_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Handler_DisplaySchedules_Call) RunAndReturn(run func(string, []string) error) *Handler_DisplaySchedules_Call { + _c.Call.Return(run) + return _c +} + +// DisplayStatus provides a mock function with given fields: profileName +func (_m *Handler) DisplayStatus(profileName string) error { + ret := _m.Called(profileName) + + if len(ret) == 0 { + panic("no return value specified for DisplayStatus") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(profileName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Handler_DisplayStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisplayStatus' +type Handler_DisplayStatus_Call struct { + *mock.Call +} + +// DisplayStatus is a helper method to define mock.On call +// - profileName string +func (_e *Handler_Expecter) DisplayStatus(profileName interface{}) *Handler_DisplayStatus_Call { + return &Handler_DisplayStatus_Call{Call: _e.mock.On("DisplayStatus", profileName)} +} + +func (_c *Handler_DisplayStatus_Call) Run(run func(profileName string)) *Handler_DisplayStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Handler_DisplayStatus_Call) Return(_a0 error) *Handler_DisplayStatus_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Handler_DisplayStatus_Call) RunAndReturn(run func(string) error) *Handler_DisplayStatus_Call { + _c.Call.Return(run) + return _c +} + +// Init provides a mock function with given fields: +func (_m *Handler) Init() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Init") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Handler_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init' +type Handler_Init_Call struct { + *mock.Call +} + +// Init is a helper method to define mock.On call +func (_e *Handler_Expecter) Init() *Handler_Init_Call { + return &Handler_Init_Call{Call: _e.mock.On("Init")} +} + +func (_c *Handler_Init_Call) Run(run func()) *Handler_Init_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Handler_Init_Call) Return(_a0 error) *Handler_Init_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Handler_Init_Call) RunAndReturn(run func() error) *Handler_Init_Call { + _c.Call.Return(run) + return _c +} + +// ParseSchedules provides a mock function with given fields: schedules +func (_m *Handler) ParseSchedules(schedules []string) ([]*calendar.Event, error) { + ret := _m.Called(schedules) + + if len(ret) == 0 { + panic("no return value specified for ParseSchedules") + } + + var r0 []*calendar.Event + var r1 error + if rf, ok := ret.Get(0).(func([]string) ([]*calendar.Event, error)); ok { + return rf(schedules) + } + if rf, ok := ret.Get(0).(func([]string) []*calendar.Event); ok { + r0 = rf(schedules) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*calendar.Event) + } + } + + if rf, ok := ret.Get(1).(func([]string) error); ok { + r1 = rf(schedules) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Handler_ParseSchedules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseSchedules' +type Handler_ParseSchedules_Call struct { + *mock.Call +} + +// ParseSchedules is a helper method to define mock.On call +// - schedules []string +func (_e *Handler_Expecter) ParseSchedules(schedules interface{}) *Handler_ParseSchedules_Call { + return &Handler_ParseSchedules_Call{Call: _e.mock.On("ParseSchedules", schedules)} +} + +func (_c *Handler_ParseSchedules_Call) Run(run func(schedules []string)) *Handler_ParseSchedules_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]string)) + }) + return _c +} + +func (_c *Handler_ParseSchedules_Call) Return(_a0 []*calendar.Event, _a1 error) *Handler_ParseSchedules_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Handler_ParseSchedules_Call) RunAndReturn(run func([]string) ([]*calendar.Event, error)) *Handler_ParseSchedules_Call { + _c.Call.Return(run) + return _c +} + +// RemoveJob provides a mock function with given fields: job, permission +func (_m *Handler) RemoveJob(job *config.ScheduleConfig, permission string) error { + ret := _m.Called(job, permission) + + if len(ret) == 0 { + panic("no return value specified for RemoveJob") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*config.ScheduleConfig, string) error); ok { + r0 = rf(job, permission) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Handler_RemoveJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveJob' +type Handler_RemoveJob_Call struct { + *mock.Call +} + +// RemoveJob is a helper method to define mock.On call +// - job *config.ScheduleConfig +// - permission string +func (_e *Handler_Expecter) RemoveJob(job interface{}, permission interface{}) *Handler_RemoveJob_Call { + return &Handler_RemoveJob_Call{Call: _e.mock.On("RemoveJob", job, permission)} +} + +func (_c *Handler_RemoveJob_Call) Run(run func(job *config.ScheduleConfig, permission string)) *Handler_RemoveJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*config.ScheduleConfig), args[1].(string)) + }) + return _c +} + +func (_c *Handler_RemoveJob_Call) Return(_a0 error) *Handler_RemoveJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Handler_RemoveJob_Call) RunAndReturn(run func(*config.ScheduleConfig, string) error) *Handler_RemoveJob_Call { + _c.Call.Return(run) + return _c +} + +// NewHandler creates a new instance of Handler. 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 NewHandler(t interface { + mock.TestingT + Cleanup(func()) +}) *Handler { + mock := &Handler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}