From 77055aa2cb34b4c0be220bfcbeb13fd2396ae231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=28=D0=A5?= =?UTF-8?q?=D1=80=D0=B0=D0=BC=D1=8B=D1=87=D0=AA=29=20=D0=A5=D1=80=D0=B0?= =?UTF-8?q?=D0=BC=D0=BE=D0=B2?= Date: Tue, 26 Aug 2025 23:16:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B5=D1=81=D1=82=D0=B0=20dlc?= =?UTF-8?q?ache=5Ftest.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/pre-commit.yaml | 2 +- pkg/dlcache/dlcache_test.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/pre-commit.yaml b/.gitea/workflows/pre-commit.yaml index abd975b..180b874 100644 --- a/.gitea/workflows/pre-commit.yaml +++ b/.gitea/workflows/pre-commit.yaml @@ -44,7 +44,7 @@ jobs: python-version: '3.12' - 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: pre-commit install diff --git a/pkg/dlcache/dlcache_test.go b/pkg/dlcache/dlcache_test.go index a7ccb8e..b10bbd1 100644 --- a/pkg/dlcache/dlcache_test.go +++ b/pkg/dlcache/dlcache_test.go @@ -26,6 +26,7 @@ import ( "io" "os" "path/filepath" + "strings" "testing" "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 { t.Helper() - dir, err := os.MkdirTemp("/tmp", "alr-dlcache-test.*") + dir, err := os.MkdirTemp("", "alr-dlcache-test.*") if err != nil { panic(err) } @@ -57,7 +58,7 @@ func prepare(t *testing.T) *TestALRConfig { func cleanup(t *testing.T, cfg *TestALRConfig) { t.Helper() - os.Remove(cfg.CacheDir) + os.RemoveAll(cfg.CacheDir) } func TestNew(t *testing.T) {