From 644a3a9d78a691af8f0f5ab04d5d44207b5d03dc Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Fri, 25 Nov 2022 22:40:20 +0800 Subject: refactor(db): migrate `ChangeUsername` off `user.go` (#7261) --- internal/repoutil/repoutil_test.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'internal/repoutil/repoutil_test.go') diff --git a/internal/repoutil/repoutil_test.go b/internal/repoutil/repoutil_test.go index 232ecc52..cd0e7e44 100644 --- a/internal/repoutil/repoutil_test.go +++ b/internal/repoutil/repoutil_test.go @@ -125,3 +125,39 @@ func TestRepositoryPath(t *testing.T) { want := "/home/git/gogs-repositories/alice/example.git" assert.Equal(t, want, got) } + +func TestRepositoryLocalPath(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Skipping testing on Windows") + return + } + + conf.SetMockServer( + t, + conf.ServerOpts{ + AppDataPath: "data", + }, + ) + + got := RepositoryLocalPath(1) + want := "data/tmp/local-repo/1" + assert.Equal(t, want, got) +} + +func TestRepositoryLocalWikiPath(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("Skipping testing on Windows") + return + } + + conf.SetMockServer( + t, + conf.ServerOpts{ + AppDataPath: "data", + }, + ) + + got := RepositoryLocalWikiPath(1) + want := "data/tmp/local-wiki/1" + assert.Equal(t, want, got) +} -- cgit v1.2.3