コード例 #1
0
func TestNewImageFromURLErrorWithCrapFile(t *testing.T) {
	ts := httptest.NewServer(http.FileServer(http.Dir(".")))
	defer ts.Close()

	_, err := chrootly.NewImageFromURL(ts.URL + "/crap_image.tar")

	assert.NotNil(t, err)
}
コード例 #2
0
func TestNewImageFromURL(t *testing.T) {
	ts := httptest.NewServer(http.FileServer(http.Dir(".")))
	defer ts.Close()

	image, _ := chrootly.NewImageFromURL(ts.URL + "/test_image.tar")

	assert.NotNil(t, image)
	assertImageSetup(t, image.Directory)
}
コード例 #3
0
func TestNewImageFromURLErrorWithCrapURL(t *testing.T) {
	_, err := chrootly.NewImageFromURL("jabberwocky")

	assert.NotNil(t, err)
}