MCPcopy Create free account
hub / github.com/go-git/go-billy / TestOpenFileWithModes

Method TestOpenFileWithModes

test/basic.go:196–204  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

194}
195
196func (s *BasicSuite) TestOpenFileWithModes(c *C) {
197 f, err := s.FS.OpenFile("foo", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, customMode)
198 c.Assert(err, IsNil)
199 c.Assert(f.Close(), IsNil)
200
201 fi, err := s.FS.Stat("foo")
202 c.Assert(err, IsNil)
203 c.Assert(fi.Mode(), Equals, os.FileMode(customMode))
204}
205
206func (s *BasicSuite) testWriteClose(c *C, f File, content string) {
207 written, err := f.Write([]byte(content))

Callers

nothing calls this directly

Calls 4

ModeMethod · 0.80
OpenFileMethod · 0.65
StatMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected