Manager: allow setup to finish without Blender #104306
@ -297,25 +297,13 @@ func TestSaveSetupAssistantConfig(t *testing.T) {
|
||||
|
||||
// Test situation where file association with .blend files resulted in a blender executable.
|
||||
{
|
||||
mockedPayload := struct {
|
||||
IsUsable bool
|
||||
Input string
|
||||
Path string
|
||||
Source api.BlenderPathSource
|
||||
}{
|
||||
IsUsable: true,
|
||||
Input: "",
|
||||
Path: "/path/to/blender",
|
||||
Source: api.BlenderPathSourceFileAssociation,
|
||||
}
|
||||
|
||||
savedConfig := doTest(api.SetupAssistantConfig{
|
||||
StorageLocation: mf.tempdir,
|
||||
BlenderExecutable: api.BlenderPathCheckResult{
|
||||
IsUsable: &mockedPayload.IsUsable,
|
||||
Input: &mockedPayload.Input,
|
||||
Path: &mockedPayload.Path,
|
||||
Source: mockedPayload.Source,
|
||||
IsUsable: true,
|
||||
Input: "",
|
||||
Path: "/path/to/blender",
|
||||
Source: api.BlenderPathSourceFileAssociation,
|
||||
},
|
||||
})
|
||||
assert.Equal(t, mf.tempdir, savedConfig.SharedStoragePath)
|
||||
@ -332,24 +320,13 @@ func TestSaveSetupAssistantConfig(t *testing.T) {
|
||||
|
||||
// Test situation where the given command could be found on $PATH.
|
||||
{
|
||||
mockedPayload := struct {
|
||||
IsUsable bool
|
||||
Input string
|
||||
Path string
|
||||
Source api.BlenderPathSource
|
||||
}{
|
||||
IsUsable: true,
|
||||
Input: "kitty",
|
||||
Path: "/path/to/kitty",
|
||||
Source: api.BlenderPathSourcePathEnvvar,
|
||||
}
|
||||
savedConfig := doTest(api.SetupAssistantConfig{
|
||||
StorageLocation: mf.tempdir,
|
||||
BlenderExecutable: api.BlenderPathCheckResult{
|
||||
IsUsable: &mockedPayload.IsUsable,
|
||||
Input: &mockedPayload.Input,
|
||||
Path: &mockedPayload.Path,
|
||||
Source: mockedPayload.Source,
|
||||
IsUsable: true,
|
||||
Input: "kitty",
|
||||
Path: "/path/to/kitty",
|
||||
Source: api.BlenderPathSourcePathEnvvar,
|
||||
},
|
||||
})
|
||||
assert.Equal(t, mf.tempdir, savedConfig.SharedStoragePath)
|
||||
@ -366,24 +343,13 @@ func TestSaveSetupAssistantConfig(t *testing.T) {
|
||||
|
||||
// Test a custom command given with the full path.
|
||||
{
|
||||
mockedPayload := struct {
|
||||
IsUsable bool
|
||||
Input string
|
||||
Path string
|
||||
Source api.BlenderPathSource
|
||||
}{
|
||||
IsUsable: true,
|
||||
Input: "/bin/cat",
|
||||
Path: "/bin/cat",
|
||||
Source: api.BlenderPathSourceInputPath,
|
||||
}
|
||||
savedConfig := doTest(api.SetupAssistantConfig{
|
||||
StorageLocation: mf.tempdir,
|
||||
BlenderExecutable: api.BlenderPathCheckResult{
|
||||
IsUsable: &mockedPayload.IsUsable,
|
||||
Input: &mockedPayload.Input,
|
||||
Path: &mockedPayload.Path,
|
||||
Source: mockedPayload.Source,
|
||||
IsUsable: true,
|
||||
Input: "/bin/cat",
|
||||
Path: "/bin/cat",
|
||||
Source: api.BlenderPathSourceInputPath,
|
||||
},
|
||||
})
|
||||
assert.Equal(t, mf.tempdir, savedConfig.SharedStoragePath)
|
||||
@ -397,34 +363,6 @@ func TestSaveSetupAssistantConfig(t *testing.T) {
|
||||
assert.Equal(t, expectBlenderVar, savedConfig.Variables["blender"])
|
||||
assert.Equal(t, defaultBlenderArgsVar, savedConfig.Variables["blenderArgs"])
|
||||
}
|
||||
|
||||
// Test situation where adding a blender executable was skipped.
|
||||
{
|
||||
mockedPayload := struct {
|
||||
IsUsable bool
|
||||
Source api.BlenderPathSource
|
||||
}{
|
||||
IsUsable: true,
|
||||
Source: api.BlenderPathSourceDefault,
|
||||
}
|
||||
savedConfig := doTest(api.SetupAssistantConfig{
|
||||
StorageLocation: mf.tempdir,
|
||||
BlenderExecutable: api.BlenderPathCheckResult{
|
||||
IsUsable: &mockedPayload.IsUsable,
|
||||
Source: mockedPayload.Source,
|
||||
},
|
||||
})
|
||||
assert.Equal(t, mf.tempdir, savedConfig.SharedStoragePath)
|
||||
expectBlenderVar := config.Variable{
|
||||
Values: config.VariableValues{
|
||||
{Platform: "linux", Value: "blender"},
|
||||
{Platform: "windows", Value: "blender"},
|
||||
{Platform: "darwin", Value: "blender"},
|
||||
},
|
||||
}
|
||||
assert.Equal(t, expectBlenderVar, savedConfig.Variables["blender"])
|
||||
assert.Equal(t, defaultBlenderArgsVar, savedConfig.Variables["blenderArgs"])
|
||||
}
|
||||
}
|
||||
|
||||
func metaTestFixtures(t *testing.T) (mockedFlamenco, func()) {
|
||||
|
Loading…
Reference in New Issue
Block a user