refactor: implement mocking functions and tests
This commit is contained in:
parent
339dba4e13
commit
f8ef2ef2d5
21 changed files with 398 additions and 90 deletions
|
|
@ -75,7 +75,7 @@ func installFlatpak(os *OS, sudoPassword string) error {
|
|||
|
||||
func addFlatpakRemotes(remotes []Remote) error {
|
||||
for _, remote := range remotes {
|
||||
cmd := exec.Command("flatpak", "remote-add", "--if-not-exists", remote.Name, remote.URL)
|
||||
cmd := execCommand("flatpak", "remote-add", "--if-not-exists", remote.Name, remote.URL)
|
||||
if err := cmd.Run(); err != nil {
|
||||
return fmt.Errorf("fehler beim Hinzufügen des Remotes %s: %v", remote.Name, err)
|
||||
}
|
||||
|
|
@ -84,6 +84,6 @@ func addFlatpakRemotes(remotes []Remote) error {
|
|||
}
|
||||
|
||||
func (f *FlatpakManager) InstallPackage(pkg string) error {
|
||||
cmd := exec.Command("flatpak", "install", "-y", pkg)
|
||||
cmd := execCommand("flatpak", "install", "-y", pkg)
|
||||
return cmd.Run()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue