Implement storage git tests

This commit is contained in:
2024-11-20 22:06:38 +01:00
parent 7396b57a5d
commit 6cb5aec372
5 changed files with 312 additions and 19 deletions

View File

@@ -11,7 +11,10 @@ import (
func TestValidatePath(t *testing.T) {
mockFS := NewMockFS()
s := storage.NewServiceWithFS("test-root", mockFS)
s := storage.NewServiceWithOptions("test-root", storage.Options{
Fs: mockFS,
NewGitClient: nil,
})
testCases := []struct {
name string
@@ -94,7 +97,10 @@ func TestValidatePath(t *testing.T) {
func TestGetWorkspacePath(t *testing.T) {
mockFS := NewMockFS()
s := storage.NewServiceWithFS("test-root", mockFS)
s := storage.NewServiceWithOptions("test-root", storage.Options{
Fs: mockFS,
NewGitClient: nil,
})
testCases := []struct {
name string
@@ -134,7 +140,10 @@ func TestGetWorkspacePath(t *testing.T) {
func TestInitializeUserWorkspace(t *testing.T) {
mockFS := NewMockFS()
s := storage.NewServiceWithFS("test-root", mockFS)
s := storage.NewServiceWithOptions("test-root", storage.Options{
Fs: mockFS,
NewGitClient: nil,
})
testCases := []struct {
name string
@@ -199,7 +208,10 @@ func TestInitializeUserWorkspace(t *testing.T) {
func TestDeleteUserWorkspace(t *testing.T) {
mockFS := NewMockFS()
s := storage.NewServiceWithFS("test-root", mockFS)
s := storage.NewServiceWithOptions("test-root", storage.Options{
Fs: mockFS,
NewGitClient: nil,
})
testCases := []struct {
name string