исправление теста dlcache_test.go
Some checks failed
Pre-commit / pre-commit (push) Failing after 5m11s

This commit is contained in:
2025-08-26 23:16:31 +03:00
parent 737bf68f95
commit 77055aa2cb
2 changed files with 4 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ jobs:
python-version: '3.12' python-version: '3.12'
- name: Install deps - name: Install deps
run: sudo apt-get update && sudo apt-get install -y gettext bc run: apt-get update && apt-get install -y gettext bc
- run: pip install pre-commit - run: pip install pre-commit
- run: pre-commit install - run: pre-commit install

View File

@@ -26,6 +26,7 @@ import (
"io" "io"
"os" "os"
"path/filepath" "path/filepath"
"strings"
"testing" "testing"
"gitea.plemya-x.ru/Plemya-x/ALR/internal/config" "gitea.plemya-x.ru/Plemya-x/ALR/internal/config"
@@ -45,7 +46,7 @@ func (c *TestALRConfig) GetPaths() *config.Paths {
func prepare(t *testing.T) *TestALRConfig { func prepare(t *testing.T) *TestALRConfig {
t.Helper() t.Helper()
dir, err := os.MkdirTemp("/tmp", "alr-dlcache-test.*") dir, err := os.MkdirTemp("", "alr-dlcache-test.*")
if err != nil { if err != nil {
panic(err) panic(err)
} }
@@ -57,7 +58,7 @@ func prepare(t *testing.T) *TestALRConfig {
func cleanup(t *testing.T, cfg *TestALRConfig) { func cleanup(t *testing.T, cfg *TestALRConfig) {
t.Helper() t.Helper()
os.Remove(cfg.CacheDir) os.RemoveAll(cfg.CacheDir)
} }
func TestNew(t *testing.T) { func TestNew(t *testing.T) {