go-billy: git.wegmueller.it/toasterson/go-billy/test Index | Files

package test

import "git.wegmueller.it/toasterson/go-billy/test"

Index

Package Files

basic.go chroot.go common_posix.go dir.go fs.go mock.go symlink.go tempfile.go

type BasicMock Uses

type BasicMock struct {
    CreateArgs   []string
    OpenArgs     []string
    OpenFileArgs [][3]interface{}
    StatArgs     []string
    RenameArgs   [][2]string
    RemoveArgs   []string
    JoinArgs     [][]string
}

func (*BasicMock) Create Uses

func (fs *BasicMock) Create(filename string) (billy.File, error)

func (*BasicMock) Join Uses

func (fs *BasicMock) Join(elem ...string) string

func (*BasicMock) Open Uses

func (fs *BasicMock) Open(filename string) (billy.File, error)

func (*BasicMock) OpenFile Uses

func (fs *BasicMock) OpenFile(filename string, flag int, mode os.FileMode) (billy.File, error)

func (*BasicMock) Remove Uses

func (fs *BasicMock) Remove(filename string) error

func (*BasicMock) Rename Uses

func (fs *BasicMock) Rename(target, link string) error

func (*BasicMock) Stat Uses

func (fs *BasicMock) Stat(filename string) (os.FileInfo, error)

type BasicSuite Uses

type BasicSuite struct {
    FS Basic
}

BasicSuite is a convenient test suite to validate any implementation of billy.Basic

func (*BasicSuite) TestCreate Uses

func (s *BasicSuite) TestCreate(c *C)

func (*BasicSuite) TestCreateAndClose Uses

func (s *BasicSuite) TestCreateAndClose(c *C)

func (*BasicSuite) TestCreateDepth Uses

func (s *BasicSuite) TestCreateDepth(c *C)

func (*BasicSuite) TestCreateDepthAbsolute Uses

func (s *BasicSuite) TestCreateDepthAbsolute(c *C)

func (*BasicSuite) TestCreateOverwrite Uses

func (s *BasicSuite) TestCreateOverwrite(c *C)

func (*BasicSuite) TestFileCloseTwice Uses

func (s *BasicSuite) TestFileCloseTwice(c *C)

func (*BasicSuite) TestFileClosed Uses

func (s *BasicSuite) TestFileClosed(c *C)

func (*BasicSuite) TestFileNonRead Uses

func (s *BasicSuite) TestFileNonRead(c *C)

func (*BasicSuite) TestFileRead Uses

func (s *BasicSuite) TestFileRead(c *C)

func (*BasicSuite) TestFileSeekClosed Uses

func (s *BasicSuite) TestFileSeekClosed(c *C)

func (*BasicSuite) TestFileSeekCurrent Uses

func (s *BasicSuite) TestFileSeekCurrent(c *C)

func (*BasicSuite) TestFileSeekEnd Uses

func (s *BasicSuite) TestFileSeekEnd(c *C)

func (*BasicSuite) TestFileSeekstart Uses

func (s *BasicSuite) TestFileSeekstart(c *C)

func (*BasicSuite) TestFileWrite Uses

func (s *BasicSuite) TestFileWrite(c *C)

func (*BasicSuite) TestFileWriteClose Uses

func (s *BasicSuite) TestFileWriteClose(c *C)

func (*BasicSuite) TestJoin Uses

func (s *BasicSuite) TestJoin(c *C)

func (*BasicSuite) TestOpen Uses

func (s *BasicSuite) TestOpen(c *C)

func (*BasicSuite) TestOpenAndStat Uses

func (s *BasicSuite) TestOpenAndStat(c *C)

func (*BasicSuite) TestOpenAndWrite Uses

func (s *BasicSuite) TestOpenAndWrite(c *C)

func (*BasicSuite) TestOpenFile Uses

func (s *BasicSuite) TestOpenFile(c *C)

func (*BasicSuite) TestOpenFileAppend Uses

func (s *BasicSuite) TestOpenFileAppend(c *C)

func (*BasicSuite) TestOpenFileNoTruncate Uses

func (s *BasicSuite) TestOpenFileNoTruncate(c *C)

func (*BasicSuite) TestOpenFileReadWrite Uses

func (s *BasicSuite) TestOpenFileReadWrite(c *C)

func (*BasicSuite) TestOpenFileWithModes Uses

func (s *BasicSuite) TestOpenFileWithModes(c *C)

func (*BasicSuite) TestOpenNotExists Uses

func (s *BasicSuite) TestOpenNotExists(c *C)

func (*BasicSuite) TestReadAtEOF Uses

func (s *BasicSuite) TestReadAtEOF(c *C)

func (*BasicSuite) TestReadAtOffset Uses

func (s *BasicSuite) TestReadAtOffset(c *C)

func (*BasicSuite) TestReadAtOnReadOnly Uses

func (s *BasicSuite) TestReadAtOnReadOnly(c *C)

func (*BasicSuite) TestReadAtOnReadWrite Uses

func (s *BasicSuite) TestReadAtOnReadWrite(c *C)

func (*BasicSuite) TestReadWriteLargeFile Uses

func (s *BasicSuite) TestReadWriteLargeFile(c *C)

func (*BasicSuite) TestRemove Uses

func (s *BasicSuite) TestRemove(c *C)

func (*BasicSuite) TestRemoveNonExisting Uses

func (s *BasicSuite) TestRemoveNonExisting(c *C)

func (*BasicSuite) TestRemoveNotEmptyDir Uses

func (s *BasicSuite) TestRemoveNotEmptyDir(c *C)

func (*BasicSuite) TestRename Uses

func (s *BasicSuite) TestRename(c *C)

func (*BasicSuite) TestSeekToEndAndWrite Uses

func (s *BasicSuite) TestSeekToEndAndWrite(c *C)

func (*BasicSuite) TestStat Uses

func (s *BasicSuite) TestStat(c *C)

func (*BasicSuite) TestStatDeep Uses

func (s *BasicSuite) TestStatDeep(c *C)

func (*BasicSuite) TestStatNonExistent Uses

func (s *BasicSuite) TestStatNonExistent(c *C)

func (*BasicSuite) TestTruncate Uses

func (s *BasicSuite) TestTruncate(c *C)

func (*BasicSuite) TestWriteFile Uses

func (s *BasicSuite) TestWriteFile(c *C)

type ChrootSuite Uses

type ChrootSuite struct {
    FS interface {
        Basic
        Chroot
    }
}

ChrootSuite is a convenient test suite to validate any implementation of billy.Chroot

func (*ChrootSuite) TestCreateWithChroot Uses

func (s *ChrootSuite) TestCreateWithChroot(c *C)

func (*ChrootSuite) TestOpenOutOffBoundary Uses

func (s *ChrootSuite) TestOpenOutOffBoundary(c *C)

func (*ChrootSuite) TestOpenWithChroot Uses

func (s *ChrootSuite) TestOpenWithChroot(c *C)

func (*ChrootSuite) TestReadDirWithChroot Uses

func (s *ChrootSuite) TestReadDirWithChroot(c *C)

func (*ChrootSuite) TestRemoveOutOffBoundary Uses

func (s *ChrootSuite) TestRemoveOutOffBoundary(c *C)

func (*ChrootSuite) TestRenameOutOffBoundary Uses

func (s *ChrootSuite) TestRenameOutOffBoundary(c *C)

func (*ChrootSuite) TestStatOutOffBoundary Uses

func (s *ChrootSuite) TestStatOutOffBoundary(c *C)

func (*ChrootSuite) TestStatWithChroot Uses

func (s *ChrootSuite) TestStatWithChroot(c *C)

type DirMock Uses

type DirMock struct {
    BasicMock
    ReadDirArgs  []string
    MkdirAllArgs [][2]interface{}
}

func (*DirMock) MkdirAll Uses

func (fs *DirMock) MkdirAll(filename string, perm os.FileMode) error

func (*DirMock) ReadDir Uses

func (fs *DirMock) ReadDir(path string) ([]os.FileInfo, error)

type DirSuite Uses

type DirSuite struct {
    FS interface {
        Basic
        Dir
    }
}

DirSuite is a convenient test suite to validate any implementation of billy.Dir

func (*DirSuite) TestMkdirAll Uses

func (s *DirSuite) TestMkdirAll(c *C)

func (*DirSuite) TestMkdirAllAndCreate Uses

func (s *DirSuite) TestMkdirAllAndCreate(c *C)

func (*DirSuite) TestMkdirAllIdempotent Uses

func (s *DirSuite) TestMkdirAllIdempotent(c *C)

func (*DirSuite) TestMkdirAllNested Uses

func (s *DirSuite) TestMkdirAllNested(c *C)

func (*DirSuite) TestMkdirAllWithExistingFile Uses

func (s *DirSuite) TestMkdirAllWithExistingFile(c *C)

func (*DirSuite) TestReadDir Uses

func (s *DirSuite) TestReadDir(c *C)

func (*DirSuite) TestReadDirFileInfo Uses

func (s *DirSuite) TestReadDirFileInfo(c *C)

func (*DirSuite) TestReadDirFileInfoDirs Uses

func (s *DirSuite) TestReadDirFileInfoDirs(c *C)

func (*DirSuite) TestReadDirNested Uses

func (s *DirSuite) TestReadDirNested(c *C)

func (*DirSuite) TestReadDirWithMkDirAll Uses

func (s *DirSuite) TestReadDirWithMkDirAll(c *C)

func (*DirSuite) TestRenameDir Uses

func (s *DirSuite) TestRenameDir(c *C)

func (*DirSuite) TestRenameToDir Uses

func (s *DirSuite) TestRenameToDir(c *C)

func (*DirSuite) TestStatDir Uses

func (s *DirSuite) TestStatDir(c *C)

type FileMock Uses

type FileMock struct {
    bytes.Buffer
    // contains filtered or unexported fields
}

func (*FileMock) Close Uses

func (*FileMock) Close() error

func (*FileMock) Lock Uses

func (*FileMock) Lock() error

func (*FileMock) Name Uses

func (f *FileMock) Name() string

func (*FileMock) ReadAt Uses

func (*FileMock) ReadAt(b []byte, off int64) (int, error)

func (*FileMock) Seek Uses

func (*FileMock) Seek(offset int64, whence int) (int64, error)

func (*FileMock) Truncate Uses

func (*FileMock) Truncate(size int64) error

func (*FileMock) Unlock Uses

func (*FileMock) Unlock() error

type FilesystemSuite Uses

type FilesystemSuite struct {
    FS  Filesystem

    BasicSuite
    DirSuite
    SymlinkSuite
    TempFileSuite
    ChrootSuite
}

FilesystemSuite is a convenient test suite to validate any implementation of billy.Filesystem

func NewFilesystemSuite Uses

func NewFilesystemSuite(fs Filesystem) FilesystemSuite

NewFilesystemSuite returns a new FilesystemSuite based on the given fs.

func (*FilesystemSuite) TestCreateWithExistantDir Uses

func (s *FilesystemSuite) TestCreateWithExistantDir(c *C)

func (*FilesystemSuite) TestReadDir Uses

func (s *FilesystemSuite) TestReadDir(c *C)
func (s *FilesystemSuite) TestReadDirWithLink(c *C)

func (*FilesystemSuite) TestRemoveAll Uses

func (s *FilesystemSuite) TestRemoveAll(c *C)

func (*FilesystemSuite) TestRemoveAllEmptyDir Uses

func (s *FilesystemSuite) TestRemoveAllEmptyDir(c *C)

func (*FilesystemSuite) TestRemoveAllNonExistent Uses

func (s *FilesystemSuite) TestRemoveAllNonExistent(c *C)

func (*FilesystemSuite) TestRemoveAllRelative Uses

func (s *FilesystemSuite) TestRemoveAllRelative(c *C)

func (*FilesystemSuite) TestRoot Uses

func (s *FilesystemSuite) TestRoot(c *C)

func (*FilesystemSuite) TestSymlinkReadDir Uses

func (s *FilesystemSuite) TestSymlinkReadDir(c *C)

func (*FilesystemSuite) TestSymlinkToDir Uses

func (s *FilesystemSuite) TestSymlinkToDir(c *C)

func (*FilesystemSuite) TestSymlinkWithChrootBasic Uses

func (s *FilesystemSuite) TestSymlinkWithChrootBasic(c *C)

func (*FilesystemSuite) TestSymlinkWithChrootCrossBounders Uses

func (s *FilesystemSuite) TestSymlinkWithChrootCrossBounders(c *C)

type NoLockCapFs Uses

type NoLockCapFs struct {
    BasicMock
}

func (*NoLockCapFs) Capabilities Uses

func (o *NoLockCapFs) Capabilities() billy.Capability

type OnlyReadCapFs Uses

type OnlyReadCapFs struct {
    BasicMock
}

func (*OnlyReadCapFs) Capabilities Uses

func (o *OnlyReadCapFs) Capabilities() billy.Capability

type SymlinkMock Uses

type SymlinkMock struct {
    BasicMock
    LstatArgs    []string
    SymlinkArgs  [][2]string
    ReadlinkArgs []string
}

func (*SymlinkMock) Lstat Uses

func (fs *SymlinkMock) Lstat(filename string) (os.FileInfo, error)
func (fs *SymlinkMock) Readlink(link string) (string, error)
func (fs *SymlinkMock) Symlink(target, link string) error

type SymlinkSuite Uses

type SymlinkSuite struct {
    FS interface {
        Basic
        Symlink
    }
}

SymlinkSuite is a convenient test suite to validate any implementation of billy.Symlink

func (*SymlinkSuite) TestLstat Uses

func (s *SymlinkSuite) TestLstat(c *C)
func (s *SymlinkSuite) TestLstatLink(c *C)

func (*SymlinkSuite) TestOpenWithSymlinkToAbsolutePath Uses

func (s *SymlinkSuite) TestOpenWithSymlinkToAbsolutePath(c *C)

func (*SymlinkSuite) TestOpenWithSymlinkToRelativePath Uses

func (s *SymlinkSuite) TestOpenWithSymlinkToRelativePath(c *C)
func (s *SymlinkSuite) TestReadlink(c *C)

func (*SymlinkSuite) TestReadlinkWithAbsolutePath Uses

func (s *SymlinkSuite) TestReadlinkWithAbsolutePath(c *C)
func (s *SymlinkSuite) TestReadlinkWithNonExistentLink(c *C)

func (*SymlinkSuite) TestReadlinkWithNonExistentTarget Uses

func (s *SymlinkSuite) TestReadlinkWithNonExistentTarget(c *C)

func (*SymlinkSuite) TestReadlinkWithRelativePath Uses

func (s *SymlinkSuite) TestReadlinkWithRelativePath(c *C)
func (s *SymlinkSuite) TestRemoveWithSymlink(c *C)
func (s *SymlinkSuite) TestRenameWithSymlink(c *C)
func (s *SymlinkSuite) TestStatLink(c *C)
func (s *SymlinkSuite) TestSymlink(c *C)

func (*SymlinkSuite) TestSymlinkCrossDirs Uses

func (s *SymlinkSuite) TestSymlinkCrossDirs(c *C)

func (*SymlinkSuite) TestSymlinkNested Uses

func (s *SymlinkSuite) TestSymlinkNested(c *C)
func (s *SymlinkSuite) TestSymlinkWithExistingLink(c *C)

func (*SymlinkSuite) TestSymlinkWithNonExistentdTarget Uses

func (s *SymlinkSuite) TestSymlinkWithNonExistentdTarget(c *C)

type TempFileMock Uses

type TempFileMock struct {
    BasicMock
    TempFileArgs [][2]string
}

func (*TempFileMock) TempFile Uses

func (fs *TempFileMock) TempFile(dir, prefix string) (billy.File, error)

type TempFileSuite Uses

type TempFileSuite struct {
    FS interface {
        billy.Basic
        billy.TempFile
    }
}

TempFileSuite is a convenient test suite to validate any implementation of billy.TempFile

func (*TempFileSuite) TestRemoveTempFile Uses

func (s *TempFileSuite) TestRemoveTempFile(c *C)

func (*TempFileSuite) TestRenameTempFile Uses

func (s *TempFileSuite) TestRenameTempFile(c *C)

func (*TempFileSuite) TestTempFile Uses

func (s *TempFileSuite) TestTempFile(c *C)

func (*TempFileSuite) TestTempFileFullWithPath Uses

func (s *TempFileSuite) TestTempFileFullWithPath(c *C)

func (*TempFileSuite) TestTempFileMany Uses

func (s *TempFileSuite) TestTempFileMany(c *C)

func (*TempFileSuite) TestTempFileManyWithUtil Uses

func (s *TempFileSuite) TestTempFileManyWithUtil(c *C)

func (*TempFileSuite) TestTempFileWithPath Uses

func (s *TempFileSuite) TestTempFileWithPath(c *C)

Package test imports 12 packages (graph). Updated 2019-05-14. Refresh now. Tools for package owners.