This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tests): Add python layer contributor tests
Signed-off-by: Andrew Meyer <[email protected]>
- Loading branch information
1 parent
dec81bf
commit db88bc7
Showing
20 changed files
with
735 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2021-2022 VMware, Inc. | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
|
||
package python | ||
|
||
import ( | ||
"os/exec" | ||
) | ||
|
||
//go:generate mockgen -destination ../mock_python/command_runner.go . CommandRunner | ||
type CommandRunner interface { | ||
Run(cmd *exec.Cmd) (output string, err error) | ||
} | ||
|
||
type DefaultCommandRunner struct{} | ||
|
||
func NewDefaultCommandRunner() *DefaultCommandRunner { | ||
return &DefaultCommandRunner{} | ||
} | ||
|
||
func (dcr *DefaultCommandRunner) Run(cmd *exec.Cmd) (output string, err error) { | ||
buff, err := cmd.CombinedOutput() | ||
return string(buff), err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.