diff options
author | Joe Chen <jc@unknwon.io> | 2022-11-25 22:40:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-25 22:40:20 +0800 |
commit | 644a3a9d78a691af8f0f5ab04d5d44207b5d03dc (patch) | |
tree | 5afd3817f440db0425e691221798889e6e2f3ba8 /internal/repoutil/repoutil_test.go | |
parent | 93736cbc12b51bfdeef16b0934fbd5fa888f89de (diff) |
refactor(db): migrate `ChangeUsername` off `user.go` (#7261)
Diffstat (limited to 'internal/repoutil/repoutil_test.go')
-rw-r--r-- | internal/repoutil/repoutil_test.go | 36 |
1 files changed, 36 insertions, 0 deletions
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) +} |