mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-29 22:20:43 +00:00
feat(resume downloads): add basic tests
Signed-off-by: Saarthak Verma <saarthakverma739@gmail.com>
This commit is contained in:
parent
f16c7cef92
commit
d7e88754d4
2 changed files with 12 additions and 1 deletions
|
@ -282,8 +282,12 @@ func (uri URI) DownloadFile(filePath, sha string, fileN, total int, downloadStat
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to create parent directory for file %q: %v", filePath, err)
|
return fmt.Errorf("failed to create parent directory for file %q: %v", filePath, err)
|
||||||
}
|
}
|
||||||
|
/** Enabling partial downloads
|
||||||
|
* - Do I remove the partial file
|
||||||
|
* -
|
||||||
|
*/
|
||||||
// save partial download to dedicated file
|
// save partial download to dedicated file
|
||||||
|
fmt.Printf("DELETEING PARTIAL FILE")
|
||||||
tmpFilePath := filePath + ".partial"
|
tmpFilePath := filePath + ".partial"
|
||||||
|
|
||||||
// remove tmp file
|
// remove tmp file
|
||||||
|
|
|
@ -38,3 +38,10 @@ var _ = Describe("Gallery API tests", func() {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
var _ = Describe("Download Test", func() {
|
||||||
|
Context("URI", func() {
|
||||||
|
It("Resumes partially downloaded files")
|
||||||
|
It("It accurately updates progress")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue