removed choco tests

This commit is contained in:
redanthrax 2022-06-28 15:36:59 -07:00
parent 8f27cb1842
commit f42293d494

View file

@ -1,59 +1,59 @@
package choco_test package choco_test
import ( //import (
"errors" //"errors"
"strings" //"strings"
"testing" //"testing"
"github.com/amidaware/rmmagent/agent/choco" //"github.com/amidaware/rmmagent/agent/choco"
) //)
func TestInstallChoco(t *testing.T) { //func TestInstallChoco(t *testing.T) {
testTable := []struct { //testTable := []struct {
name string //name string
expectedError error //expectedError error
}{ //}{
{ //{
name: "Install Choco", //name: "Install Choco",
expectedError: nil, //expectedError: nil,
}, //},
} //}
for _, tt := range testTable { //for _, tt := range testTable {
t.Run(tt.name, func(t *testing.T) { //t.Run(tt.name, func(t *testing.T) {
err := choco.InstallChoco() //err := choco.InstallChoco()
if !errors.Is(tt.expectedError, err) { //if !errors.Is(tt.expectedError, err) {
t.Errorf("expected error (%v), got (%v)", tt.expectedError, err) //t.Errorf("expected error (%v), got (%v)", tt.expectedError, err)
} //}
}) //})
} //}
} //}
func TestInstallWithChoco(t *testing.T) { //func TestInstallWithChoco(t *testing.T) {
testTable := []struct { //testTable := []struct {
name string //name string
software string //software string
expectedString string //expectedString string
expectedError error //expectedError error
}{ //}{
{ //{
name: "Install With Choco", //name: "Install With Choco",
software: "adobereader", //software: "adobereader",
expectedString: "The install of adobereader was successful", //expectedString: "The install of adobereader was successful",
expectedError: nil, //expectedError: nil,
}, //},
} //}
for _, tt := range testTable { //for _, tt := range testTable {
t.Run(tt.name, func(t *testing.T) { //t.Run(tt.name, func(t *testing.T) {
result, err := choco.InstallWithChoco(tt.software) //result, err := choco.InstallWithChoco(tt.software)
if !errors.Is(tt.expectedError, err) { //if !errors.Is(tt.expectedError, err) {
t.Errorf("expected (%v), got (%v)", tt.expectedError, err) //t.Errorf("expected (%v), got (%v)", tt.expectedError, err)
} //}
if !strings.Contains(result, tt.expectedString) { //if !strings.Contains(result, tt.expectedString) {
t.Errorf("expected %s, got %s", tt.expectedString, result) //t.Errorf("expected %s, got %s", tt.expectedString, result)
} //}
}) //})
} //}
} //}