Skip to content

Commit

Permalink
Re-generate mock tests
Browse files Browse the repository at this point in the history
- add go generate comments to files to autogenerate mock tests
  • Loading branch information
redhatrises committed Jun 13, 2018
1 parent 97dfc06 commit 6109840
Show file tree
Hide file tree
Showing 22 changed files with 106 additions and 91 deletions.
2 changes: 2 additions & 0 deletions pkg/cli/get/resources/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"github.com/opencontrol/compliance-masonry/tools/vcs"
)

//go:generate mockery -name Downloader

// Downloader is a generic interface for how to download entries.
type Downloader interface {
DownloadRepo(common.RemoteSource, string) error
Expand Down
2 changes: 2 additions & 0 deletions pkg/cli/get/resources/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"path/filepath"
)

//go:generate mockery -name Getter

// getAllLocalResources will get try to get the resources that are in the current "source" directory and place them
// in the final "destination" workspace directory.
func getAllLocalResources(source string, destination string, opencontrol common.OpenControl, getter Getter) error {
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/get/resources/mocks/Downloader.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions pkg/cli/get/resources/mocks/Getter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/lib/common/certification.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package common

//go:generate mockery -name Certification

// Certification is the interface for getting all the attributes for a given certification.
// Schema info: https://github.com/opencontrol/schemas#certifications
//
Expand Down
4 changes: 4 additions & 0 deletions pkg/lib/common/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package common

import "github.com/blang/semver"

//go:generate mockery -name Component
//go:generate mockery -name Satisfies
//go:generate mockery -name Section

// Component is the basic building block for all systems.
// Schema info: https://github.com/opencontrol/schemas#component-yaml
//
Expand Down
2 changes: 2 additions & 0 deletions pkg/lib/common/control.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package common

//go:generate mockery -name Control

// Control is the interface for getting all the attributes for a given control.
// Schema info: https://github.com/opencontrol/schemas#standards-documentation
//
Expand Down
4 changes: 1 addition & 3 deletions pkg/lib/common/mocks/Certification.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pkg/lib/common/mocks/Component.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 7 additions & 9 deletions pkg/lib/common/mocks/Control.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pkg/lib/common/mocks/OpenControl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 7 additions & 9 deletions pkg/lib/common/mocks/RemoteSource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pkg/lib/common/mocks/Satisfies.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions pkg/lib/common/mocks/Section.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/lib/common/opencontrol.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package common

//go:generate mockery -name OpenControl
//go:generate mockery -name RemoteSource

// OpenControl is an interface that every OpenControl yaml version should implement.
// Schema info: https://github.com/opencontrol/schemas#opencontrolyaml
//
Expand Down
2 changes: 2 additions & 0 deletions pkg/lib/common/standard.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package common

//go:generate mockery -name Standard -testonly

// Standard is the container of all the information for a particular Standard.
// Schema info: https://github.com/opencontrol/schemas#standards-documentation
//
Expand Down
2 changes: 2 additions & 0 deletions pkg/lib/common/workspace.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package common

//go:generate mockery -name Workspace -testonly

// Workspace represents all the information such as components, standards, and certification as well as
// the result information such as the justifications.
type Workspace interface {
Expand Down
2 changes: 2 additions & 0 deletions pkg/lib/opencontrol/opencontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"github.com/opencontrol/compliance-masonry/pkg/lib/common"
)

//go:generate mockery -name SchemaParser -testonly

// Base is the common struct that all schemas must have.
type Base struct {
// SchemaVersion contains the schema version.
Expand Down
2 changes: 2 additions & 0 deletions tools/fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
metaleapfs "github.com/metaleap/go-util/fs"
)

//go:generate mockery -name Util

// Util is an interface for helper file system utilities.
type Util interface {
OpenAndReadFile(file string) ([]byte, error)
Expand Down

0 comments on commit 6109840

Please sign in to comment.