func TestUaAuth(t *testing.T) {
	uauth := calculateUaAuthHeader("user-agent", "user-agent-pw", "request-id", "session-id", "rets-version")
	testutils.Assert(t, "Digest 052c1af08431d3cc9717a37f9d6de169" == uauth, "bad auth")

	uauth2 := calculateUaAuthHeader("user-agent", "user-agent-pw", "", "", "rets-version")
	testutils.Assert(t, "Digest 73cc7ccfe417292b1155c5ccee7fbdab" == uauth2, "bad auth")
}
func TestParseGetObjectQuit(t *testing.T) {
	extracted := extractBoundary(contentType)

	testutils.Equals(t, boundary, extracted)

	body := ioutil.NopCloser(bytes.NewReader([]byte(multipartBody)))

	quit := make(chan struct{})
	defer close(quit)
	results := parseGetObjectsResult(quit, extracted, body)

	r1 := <-results
	testutils.Ok(t, r1.Err)
	testutils.Assert(t, r1 != GetObjectResult{}, "should not be the zerod object")
	o1 := r1.Object
	testutils.Equals(t, "image/jpeg", o1.ContentType)
	testutils.Equals(t, "123456", o1.ContentId)
	testutils.Equals(t, 1, o1.ObjectId)

	quit <- struct{}{}

	// the closed channel will emit a zero'd value of the proper type
	r2 := <-results
	testutils.Equals(t, r2, GetObjectResult{})
}
func verifyCompactData(t *testing.T, pl *PayloadList, id string) {
	payload := <-pl.Payloads
	testutils.Equals(t, 6, len(payload.Columns))

	testutils.Equals(t, id, payload.Id)
	testutils.Equals(t, "A,B,C,D,E,F", strings.Join(payload.Columns, ","))

	counter := 0
	for _, row := range payload.Rows {
		testutils.Assert(t, strings.Join(row, ",") == "1,2,3,4,5,6", fmt.Sprintf("bad row %d: %s", counter, row))

		testutils.Ok(t, pl.Error)
		counter = counter + 1
	}
	testutils.Equals(t, 8, counter)
}
func verifySystem(t *testing.T, ms Metadata) {
	testutils.Assert(t, ms.System.Version == "1.12.30", "bad version")
	testutils.Assert(t, ms.System.Comments == "The System is provided to you by Systems.", "bad comments")
}