chore(repo): reinitialize repository
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package workspace
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestNormalizeProjectForCreateAppliesDefaults(t *testing.T) {
|
||||
project := NormalizeProjectForCreate(Project{})
|
||||
if project.DefaultBranch != DefaultBranch {
|
||||
t.Fatalf("default branch = %q", project.DefaultBranch)
|
||||
}
|
||||
if project.Status != ActiveStatus {
|
||||
t.Fatalf("status = %q", project.Status)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizeWorkspaceForCreateAppliesDefaults(t *testing.T) {
|
||||
ws := NormalizeWorkspaceForCreate(Workspace{Slug: "blog"})
|
||||
if ws.BaseBranch != DefaultBranch {
|
||||
t.Fatalf("base branch = %q", ws.BaseBranch)
|
||||
}
|
||||
if ws.WorktreeBranch != "worktree/blog" {
|
||||
t.Fatalf("worktree branch = %q", ws.WorktreeBranch)
|
||||
}
|
||||
if ws.RuntimeBackend != ManagedRuntimeBackend {
|
||||
t.Fatalf("runtime backend = %q", ws.RuntimeBackend)
|
||||
}
|
||||
if ws.Status != ActiveStatus {
|
||||
t.Fatalf("status = %q", ws.Status)
|
||||
}
|
||||
if ws.ProvisionState != PendingProvisionState {
|
||||
t.Fatalf("provision state = %q", ws.ProvisionState)
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyManagedRuntimeConfig(t *testing.T) {
|
||||
ws := ApplyManagedRuntimeConfig(Workspace{Slug: "blog"}, "/tmp/workspaces", "release")
|
||||
if ws.RootPath != "/tmp/workspaces/blog" {
|
||||
t.Fatalf("root path = %q", ws.RootPath)
|
||||
}
|
||||
if ws.BaseBranch != "release" {
|
||||
t.Fatalf("base branch = %q", ws.BaseBranch)
|
||||
}
|
||||
if ws.WorktreeBranch != "worktree/blog" {
|
||||
t.Fatalf("worktree branch = %q", ws.WorktreeBranch)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user