~wallyworld/gwacl/fix-request-eof

« back to all changes in this revision

Viewing changes to storage_base_test.go

  • Committer: Tarmac
  • Author(s): Julian Edwards
  • Date: 2013-07-31 11:41:16 UTC
  • mfrom: (206.1.1 fix-get-container-props)
  • Revision ID: tarmac-20130731114116-bqi4h4x040gouz8s
[r=rvb][bug=][author=julian-edwards] Allow for optional headers in the GetContainerProperties response.

Show diffs side-by-side

added added

removed removed

Lines of Context:
781
781
    c.Check(props.LeaseDuration, Equals, "duration")
782
782
}
783
783
 
 
784
func (suite *TestGetContainerProperties) TestWithoutAllHeaders(c *C) {
 
785
    response := &http.Response{
 
786
        Status:     fmt.Sprintf("%d", http.StatusOK),
 
787
        StatusCode: http.StatusOK,
 
788
        Body:       makeResponseBody(""),
 
789
    }
 
790
 
 
791
    transport := &TestTransport{Response: response}
 
792
    context := makeStorageContext(transport)
 
793
    containerName := MakeRandomString(10)
 
794
    props, err := context.GetContainerProperties(containerName)
 
795
    c.Assert(err, IsNil)
 
796
 
 
797
    c.Check(props.LastModified, Equals, "")
 
798
    c.Check(props.ETag, Equals, "")
 
799
    c.Check(props.LeaseStatus, Equals, "")
 
800
    c.Check(props.LeaseState, Equals, "")
 
801
    c.Check(props.LeaseDuration, Equals, "")
 
802
}
 
803
 
 
804
 
784
805
// Client-side errors from the HTTP client are propagated back to the caller.
785
806
func (suite *TestGetContainerProperties) TestError(c *C) {
786
807
    error := fmt.Errorf("canned-error")