mirror of
https://github.com/distribution/distribution
synced 2024-11-12 05:45:51 +01:00
StorageDriver: Testsuite: call Close before getting Size
Signed-off-by: Arthur Baars <arthur@semmle.com>
This commit is contained in:
parent
c69c8a3286
commit
34891eb7ab
@ -412,12 +412,12 @@ func (suite *DriverSuite) testContinueStreamAppend(c *check.C, chunkSize int64)
|
||||
c.Assert(err, check.IsNil)
|
||||
c.Assert(nn, check.Equals, int64(len(contentsChunk1)))
|
||||
|
||||
curSize := writer.Size()
|
||||
c.Assert(curSize, check.Equals, int64(len(contentsChunk1)))
|
||||
|
||||
err = writer.Close()
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
curSize := writer.Size()
|
||||
c.Assert(curSize, check.Equals, int64(len(contentsChunk1)))
|
||||
|
||||
writer, err = suite.StorageDriver.Writer(suite.ctx, filename, true)
|
||||
c.Assert(err, check.IsNil)
|
||||
c.Assert(writer.Size(), check.Equals, curSize)
|
||||
@ -426,12 +426,12 @@ func (suite *DriverSuite) testContinueStreamAppend(c *check.C, chunkSize int64)
|
||||
c.Assert(err, check.IsNil)
|
||||
c.Assert(nn, check.Equals, int64(len(contentsChunk2)))
|
||||
|
||||
curSize = writer.Size()
|
||||
c.Assert(curSize, check.Equals, 2*chunkSize)
|
||||
|
||||
err = writer.Close()
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
curSize = writer.Size()
|
||||
c.Assert(curSize, check.Equals, 2*chunkSize)
|
||||
|
||||
writer, err = suite.StorageDriver.Writer(suite.ctx, filename, true)
|
||||
c.Assert(err, check.IsNil)
|
||||
c.Assert(writer.Size(), check.Equals, curSize)
|
||||
|
Loading…
Reference in New Issue
Block a user