tests: Add assertion to address review comment

This commit is contained in:
Paul Hinze 2022-05-25 12:52:55 -05:00
parent 5bd0ac371c
commit 88957f71fb
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -60,6 +60,11 @@ func TestMachineSetEmptyId(t *testing.T) {
require.Nil(t, dbTarget)
require.Error(t, err)
// Verify the DataDir still exists (see below test for more detail on why)
dir, err := tm.DataDir()
require.NoError(t, err)
require.DirExists(t, dir.DataDir().String())
// Also check new id
dbTarget, err = tm.Client().GetTarget(tm.ctx,
&vagrant_server.GetTargetRequest{
@ -74,7 +79,7 @@ func TestMachineSetEmptyId(t *testing.T) {
require.Error(t, err)
}
func TestMachineSetIdBlankThenSomethingRecreatesDataDir(t *testing.T) {
func TestMachineSetIdBlankThenSomethingPreservesDataDir(t *testing.T) {
tm, _ := TestMinimalMachine(t)
// Set empty id, followed by a temp id. This is the same thing that happens