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.
|
// Test situation where file association with .blend files resulted in a blender executable.
|
||||||
{
|
{
|
||||||
mockedPayload := struct {
|
savedConfig := doTest(api.SetupAssistantConfig{
|
||||||
IsUsable bool
|
StorageLocation: mf.tempdir,
|
||||||
Input string
|
BlenderExecutable: api.BlenderPathCheckResult{
|
||||||
Path string
|
|
||||||
Source api.BlenderPathSource
|
|
||||||
}{
|
|
||||||
IsUsable: true,
|
IsUsable: true,
|
||||||
Input: "",
|
Input: "",
|
||||||
Path: "/path/to/blender",
|
Path: "/path/to/blender",
|
||||||
Source: api.BlenderPathSourceFileAssociation,
|
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,
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
assert.Equal(t, mf.tempdir, savedConfig.SharedStoragePath)
|
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.
|
// Test situation where the given command could be found on $PATH.
|
||||||
{
|
{
|
||||||
mockedPayload := struct {
|
savedConfig := doTest(api.SetupAssistantConfig{
|
||||||
IsUsable bool
|
StorageLocation: mf.tempdir,
|
||||||
Input string
|
BlenderExecutable: api.BlenderPathCheckResult{
|
||||||
Path string
|
|
||||||
Source api.BlenderPathSource
|
|
||||||
}{
|
|
||||||
IsUsable: true,
|
IsUsable: true,
|
||||||
Input: "kitty",
|
Input: "kitty",
|
||||||
Path: "/path/to/kitty",
|
Path: "/path/to/kitty",
|
||||||
Source: api.BlenderPathSourcePathEnvvar,
|
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,
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
assert.Equal(t, mf.tempdir, savedConfig.SharedStoragePath)
|
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.
|
// Test a custom command given with the full path.
|
||||||
{
|
{
|
||||||
mockedPayload := struct {
|
savedConfig := doTest(api.SetupAssistantConfig{
|
||||||
IsUsable bool
|
StorageLocation: mf.tempdir,
|
||||||
Input string
|
BlenderExecutable: api.BlenderPathCheckResult{
|
||||||
Path string
|
|
||||||
Source api.BlenderPathSource
|
|
||||||
}{
|
|
||||||
IsUsable: true,
|
IsUsable: true,
|
||||||
Input: "/bin/cat",
|
Input: "/bin/cat",
|
||||||
Path: "/bin/cat",
|
Path: "/bin/cat",
|
||||||
Source: api.BlenderPathSourceInputPath,
|
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,
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
assert.Equal(t, mf.tempdir, savedConfig.SharedStoragePath)
|
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, 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