mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
Remove temp folders after tests
This commit is contained in:
parent
fa3471f527
commit
66a9cbb7d9
6 changed files with 30 additions and 15 deletions
|
@ -88,19 +88,25 @@ var _ = Describe("AlbumRepository", func() {
|
|||
})
|
||||
|
||||
Describe("getCoverFromPath", func() {
|
||||
testFolder, _ := os.MkdirTemp("", "album_persistence_tests")
|
||||
if err := os.MkdirAll(testFolder, 0777); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if _, err := os.Create(filepath.Join(testFolder, "Cover.jpeg")); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if _, err := os.Create(filepath.Join(testFolder, "FRONT.PNG")); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
var testFolder, testPath, embeddedPath string
|
||||
BeforeEach(func() {
|
||||
testFolder, _ = os.MkdirTemp("", "album_persistence_tests")
|
||||
if err := os.MkdirAll(testFolder, 0777); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if _, err := os.Create(filepath.Join(testFolder, "Cover.jpeg")); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if _, err := os.Create(filepath.Join(testFolder, "FRONT.PNG")); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
testPath = filepath.Join(testFolder, "somefile.test")
|
||||
embeddedPath = filepath.Join(testFolder, "somefile.mp3")
|
||||
})
|
||||
AfterEach(func() {
|
||||
_ = os.RemoveAll(testFolder)
|
||||
})
|
||||
|
||||
testPath := filepath.Join(testFolder, "somefile.test")
|
||||
embeddedPath := filepath.Join(testFolder, "somefile.mp3")
|
||||
It("returns audio file for embedded cover", func() {
|
||||
conf.Server.CoverArtPriority = "embedded, cover.*, front.*"
|
||||
Expect(getCoverFromPath(testPath, embeddedPath)).To(Equal(""))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue