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