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
DirNotExists
DirNotExists 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.DirNotExists(t T, path string, msgAndArgs ...any) bool | package-level function |
assert.DirNotExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
assert.(*Assertions).DirNotExists(path string) bool | method variant |
assert.(*Assertions).DirNotExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
require.DirNotExists(t T, path string, msgAndArgs ...any) bool | package-level function |
require.DirNotExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
require.(*Assertions).DirNotExists(path string) bool | method variant |
require.(*Assertions).DirNotExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
assertions.DirNotExists(t T, path string, msgAndArgs ...any) bool | internal implementation |
Source: github.com/go-openapi/testify/v2/internal/assertions#DirNotExists
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
FileNotExists
FileNotExists 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.FileNotExists(t T, path string, msgAndArgs ...any) bool | package-level function |
assert.FileNotExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
assert.(*Assertions).FileNotExists(path string) bool | method variant |
assert.(*Assertions).FileNotExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
require.FileNotExists(t T, path string, msgAndArgs ...any) bool | package-level function |
require.FileNotExistsf(t T, path string, msg string, args ...any) bool | formatted variant |
require.(*Assertions).FileNotExists(path string) bool | method variant |
require.(*Assertions).FileNotExistsf(path string, msg string, args ..any) | method formatted variant |
| Signature | Usage |
|---|---|
assertions.FileNotExists(t T, path string, msgAndArgs ...any) bool | internal implementation |
Source: github.com/go-openapi/testify/v2/internal/assertions#FileNotExists
Generated with github.com/go-openapi/testify/codegen/v2