feat: support different versions of the same box
This commit is contained in:
@@ -4,9 +4,34 @@ import (
|
||||
"errors"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGenerateID(t *testing.T) {
|
||||
t.Run("with version", func(t *testing.T) {
|
||||
req := Request{
|
||||
Sandbox: "python",
|
||||
Version: "dev",
|
||||
Command: "run",
|
||||
}
|
||||
req.GenerateID()
|
||||
if !strings.HasPrefix(req.ID, "python.dev_run_") {
|
||||
t.Errorf("ID: unexpected prefix %s", req.ID)
|
||||
}
|
||||
})
|
||||
t.Run("without version", func(t *testing.T) {
|
||||
req := Request{
|
||||
Sandbox: "python",
|
||||
Command: "run",
|
||||
}
|
||||
req.GenerateID()
|
||||
if !strings.HasPrefix(req.ID, "python_run_") {
|
||||
t.Errorf("ID: unexpected prefix %s", req.ID)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestExecutionError(t *testing.T) {
|
||||
inner := errors.New("inner error")
|
||||
err := NewExecutionError("failed", inner)
|
||||
|
||||
Reference in New Issue
Block a user