File
Asserting OS Files
Assertions
All links point to https://pkg.go.dev/github.com/go-openapi/testify/v2
This domain exposes 6 functionalities.
DirExists
DirExists checks whether a directory exists in the given path. It also fails if the path is a file rather a directory or there is an error checking whether it exists.
| Signature | Usage |
|---|---|
assert.DirExists(t T, path string, msgAndArgs ...any) bool | package-level function |
assert.DirExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
assert.(*Assertions).DirExists(path string) bool | method variant |
assert.(*Assertions).DirExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
require.DirExists(t T, path string, msgAndArgs ...any) bool | package-level function |
require.DirExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
require.(*Assertions).DirExists(path string) bool | method variant |
require.(*Assertions).DirExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
assertions.DirExists(t T, path string, msgAndArgs ...any) bool | internal implementation |
Source: github.com/go-openapi/testify/v2/internal/assertions#DirExists
FileEmpty
FileEmpty checks whether a file exists in the given path and is empty. It fails if the file is not empty, if the path points to a directory or there is an error when trying to check the file.
| Signature | Usage |
|---|---|
assert.FileEmpty(t T, path string, msgAndArgs ...any) bool | package-level function |
assert.FileEmptyf(t T, path string, msg string, args ...any) bool | formatted variant |
assert.(*Assertions).FileEmpty(path string) bool | method variant |
assert.(*Assertions).FileEmptyf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
require.FileEmpty(t T, path string, msgAndArgs ...any) bool | package-level function |
require.FileEmptyf(t T, path string, msg string, args ...any) bool | formatted variant |
require.(*Assertions).FileEmpty(path string) bool | method variant |
require.(*Assertions).FileEmptyf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
assertions.FileEmpty(t T, path string, msgAndArgs ...any) bool | internal implementation |
Source: github.com/go-openapi/testify/v2/internal/assertions#FileEmpty
FileExists
FileExists checks whether a file exists in the given path. It also fails if the path points to a directory or there is an error when trying to check the file.
| Signature | Usage |
|---|---|
assert.FileExists(t T, path string, msgAndArgs ...any) bool | package-level function |
assert.FileExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
assert.(*Assertions).FileExists(path string) bool | method variant |
assert.(*Assertions).FileExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
require.FileExists(t T, path string, msgAndArgs ...any) bool | package-level function |
require.FileExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
require.(*Assertions).FileExists(path string) bool | method variant |
require.(*Assertions).FileExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
assertions.FileExists(t T, path string, msgAndArgs ...any) bool | internal implementation |
Source: github.com/go-openapi/testify/v2/internal/assertions#FileExists
FileNotEmpty
FileNotEmpty checks whether a file exists in the given path and is not empty. It fails if the file is empty, if the path points to a directory or there is an error when trying to check the file.
| Signature | Usage |
|---|---|
assert.FileNotEmpty(t T, path string, msgAndArgs ...any) bool | package-level function |
assert.FileNotEmptyf(t T, path string, msg string, args ...any) bool | formatted variant |
assert.(*Assertions).FileNotEmpty(path string) bool | method variant |
assert.(*Assertions).FileNotEmptyf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
require.FileNotEmpty(t T, path string, msgAndArgs ...any) bool | package-level function |
require.FileNotEmptyf(t T, path string, msg string, args ...any) bool | formatted variant |
require.(*Assertions).FileNotEmpty(path string) bool | method variant |
require.(*Assertions).FileNotEmptyf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
assertions.FileNotEmpty(t T, path string, msgAndArgs ...any) bool | internal implementation |
Source: github.com/go-openapi/testify/v2/internal/assertions#FileNotEmpty
NoDirExists
NoDirExists checks whether a directory does not exist in the given path. It fails if the path points to an existing directory only.
| Signature | Usage |
|---|---|
assert.NoDirExists(t T, path string, msgAndArgs ...any) bool | package-level function |
assert.NoDirExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
assert.(*Assertions).NoDirExists(path string) bool | method variant |
assert.(*Assertions).NoDirExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
require.NoDirExists(t T, path string, msgAndArgs ...any) bool | package-level function |
require.NoDirExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
require.(*Assertions).NoDirExists(path string) bool | method variant |
require.(*Assertions).NoDirExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
assertions.NoDirExists(t T, path string, msgAndArgs ...any) bool | internal implementation |
Source: github.com/go-openapi/testify/v2/internal/assertions#NoDirExists
NoFileExists
NoFileExists checks whether a file does not exist in a given path. It fails if the path points to an existing file only.
| Signature | Usage |
|---|---|
assert.NoFileExists(t T, path string, msgAndArgs ...any) bool | package-level function |
assert.NoFileExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
assert.(*Assertions).NoFileExists(path string) bool | method variant |
assert.(*Assertions).NoFileExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
require.NoFileExists(t T, path string, msgAndArgs ...any) bool | package-level function |
require.NoFileExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
require.(*Assertions).NoFileExists(path string) bool | method variant |
require.(*Assertions).NoFileExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
assertions.NoFileExists(t T, path string, msgAndArgs ...any) bool | internal implementation |
Source: github.com/go-openapi/testify/v2/internal/assertions#NoFileExists
Generated with github.com/go-openapi/testify/v2/codegen