ficsit-cli-flake/cli/installations_test.go

37 lines
907 B
Go
Raw Normal View History

2021-12-02 04:00:33 +00:00
package cli
import (
"testing"
"github.com/MarvinJWendt/testza"
"github.com/satisfactorymodding/ficsit-cli/cfg"
)
func init() {
cfg.SetDefaults()
}
func TestInstallationsInit(t *testing.T) {
installations, err := InitInstallations()
testza.AssertNoError(t, err)
testza.AssertNotNil(t, installations)
}
func TestAddInstallation(t *testing.T) {
ctx, err := InitCLI()
testza.AssertNoError(t, err)
profileName := "InstallationTest"
2021-12-04 18:02:05 +00:00
profile, err := ctx.Profiles.AddProfile(profileName)
testza.AssertNoError(t, err)
2021-12-02 04:00:33 +00:00
testza.AssertNoError(t, profile.AddMod("AreaActions", ">=1.6.5"))
testza.AssertNoError(t, profile.AddMod("ArmorModules__Modpack_All", ">=1.4.1"))
installation, err := ctx.Installations.AddInstallation(ctx, "../testdata/server", profileName)
testza.AssertNoError(t, err)
testza.AssertNotNil(t, installation)
err = installation.Install(ctx)
testza.AssertNoError(t, err)
}