mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Add initial download unittests
This commit is contained in:
parent
37c9eaf346
commit
cd9338ae72
1 changed files with 32 additions and 0 deletions
32
cmd/csaf_downloader/downloader_test.go
Normal file
32
cmd/csaf_downloader/downloader_test.go
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
// This file is Free Software under the Apache-2.0 License
|
||||||
|
// without warranty, see README.md and LICENSES/Apache-2.0.txt for details.
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//
|
||||||
|
// SPDX-FileCopyrightText: 2023 German Federal Office for Information Security (BSI) <https://www.bsi.bund.de>
|
||||||
|
// Software-Engineering: 2023 Intevation GmbH <https://intevation.de>
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log/slog"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/csaf-poc/csaf_distribution/v3/csaf"
|
||||||
|
"github.com/csaf-poc/csaf_distribution/v3/internal/options"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestShaMarking(t *testing.T) {
|
||||||
|
cfg := config{LogLevel: &options.LogLevel{Level: slog.LevelDebug}}
|
||||||
|
cfg.prepare()
|
||||||
|
d, err := newDownloader(&cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("could not init downloader: %v", err)
|
||||||
|
}
|
||||||
|
defer d.close()
|
||||||
|
ctx := context.Background()
|
||||||
|
files := []csaf.AdvisoryFile{}
|
||||||
|
|
||||||
|
d.downloadFiles(ctx, csaf.TLPLabelWhite, files)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue