mirror of
https://github.com/containers/podman.git
synced 2026-02-19 07:26:18 -05:00
Use t.Helper, t.TempDir, and t.Cleanup in getEmptySqliteState, simplifying its code and its users. Simplify runForAllStates: remove redundant t.Fail call, and move getEmptySqliteState call under t.Run. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
24 lines
377 B
Go
24 lines
377 B
Go
//go:build !remote
|
|
|
|
package libpod
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func Test_generateName(t *testing.T) {
|
|
state, _ := getEmptySqliteState(t)
|
|
|
|
r := &Runtime{
|
|
state: state,
|
|
}
|
|
|
|
// Test that (*Runtime).generateName returns different names
|
|
// if called twice.
|
|
n1, _ := r.generateName()
|
|
n2, _ := r.generateName()
|
|
assert.NotEqual(t, n1, n2)
|
|
}
|