mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-07 22:20:24 +00:00
Simplify test by using WriteFile.
This commit is contained in:
Vendored
+2
-4
@@ -1,6 +1,7 @@
|
||||
package debian
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
. "launchpad.net/gocheck"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -111,12 +112,9 @@ func (s *RepositorySuite) TestLinkFromPool(c *C) {
|
||||
err := os.MkdirAll(filepath.Dir(t.sourcePath), 0755)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
file, err := os.Create(t.sourcePath)
|
||||
err = ioutil.WriteFile(t.sourcePath, []byte("Contents"), 0644)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
file.Write([]byte("Contents"))
|
||||
file.Close()
|
||||
|
||||
path, err := s.repo.LinkFromPool(t.prefix, t.component, t.sourcePath, t.poolDirectory)
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(path, Equals, t.expectedFilename)
|
||||
|
||||
Reference in New Issue
Block a user