nanovms / ops

ops - build and run nanos unikernels
https://ops.city
MIT License
1.3k stars 132 forks source link

refactor tests not to download packages each run #1309

Open eyberg opened 2 years ago

eyberg commented 2 years ago

at least 2 of these can be stubbed and the other can be stubbed diff as well

func TestGetPkgCommand(t *testing.T) {
    getPkgCmd := cmd.PackageCommands()

    getPkgCmd.SetArgs([]string{"get", "eyberg/bind:9.13.4"})

    err := getPkgCmd.Execute()

    assert.Nil(t, err)
}

func TestPkgContentsCommand(t *testing.T) {
    getPkgCmd := cmd.PackageCommands()

    getPkgCmd.SetArgs([]string{"contents", "eyberg/bind:9.13.4"})

    err := getPkgCmd.Execute()

    assert.Nil(t, err)
}

func TestPkgDescribeCommand(t *testing.T) {
    getPkgCmd := cmd.PackageCommands()

    getPkgCmd.SetArgs([]string{"describe", "eyberg/bind:9.13.4"})

    err := getPkgCmd.Execute()

    assert.Nil(t, err)
}