last_modified: rfc1123 -> rfc3339MilliNoZ (#81)
diff --git a/openstack/objectstorage/v1/objects/results.go b/openstack/objectstorage/v1/objects/results.go
index 1390faa..4f7020c 100644
--- a/openstack/objectstorage/v1/objects/results.go
+++ b/openstack/objectstorage/v1/objects/results.go
@@ -26,7 +26,7 @@
// LastModified is the RFC3339Milli time the object was last modified, represented
// as a string. For any given object (obj), this value may be parsed to a time.Time:
// lastModified, err := time.Parse(gophercloud.RFC3339Milli, obj.LastModified)
- LastModified gophercloud.JSONRFC1123 `json:"last_modified"`
+ LastModified gophercloud.JSONRFC3339MilliNoZ `json:"last_modified"`
// Name is the unique name for the object.
Name string `json:"name"`
diff --git a/openstack/objectstorage/v1/objects/testing/fixtures.go b/openstack/objectstorage/v1/objects/testing/fixtures.go
index d3144cb..53f03f5 100644
--- a/openstack/objectstorage/v1/objects/testing/fixtures.go
+++ b/openstack/objectstorage/v1/objects/testing/fixtures.go
@@ -14,10 +14,6 @@
fake "github.com/gophercloud/gophercloud/testhelper/client"
)
-var (
- loc, _ = time.LoadLocation("GMT")
-)
-
// HandleDownloadObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that
// responds with a `Download` response.
func HandleDownloadObjectSuccessfully(t *testing.T) {
@@ -36,14 +32,14 @@
var ExpectedListInfo = []objects.Object{
{
Hash: "451e372e48e0f6b1114fa0724aa79fa1",
- LastModified: gophercloud.JSONRFC1123(time.Date(2009, time.November, 10, 23, 0, 0, 0, loc)), //"2009-11-10 23:00:00 +0000 UTC"
+ LastModified: gophercloud.JSONRFC3339MilliNoZ(time.Date(2016, time.August, 17, 22, 11, 58, 602650000, time.UTC)), //"2016-08-17T22:11:58.602650"
Bytes: 14,
Name: "goodbye",
ContentType: "application/octet-stream",
},
{
Hash: "451e372e48e0f6b1114fa0724aa79fa1",
- LastModified: gophercloud.JSONRFC1123(time.Date(2009, time.November, 10, 23, 0, 0, 0, loc)),
+ LastModified: gophercloud.JSONRFC3339MilliNoZ(time.Date(2016, time.August, 17, 22, 11, 58, 602650000, time.UTC)),
Bytes: 14,
Name: "hello",
ContentType: "application/octet-stream",
@@ -70,14 +66,14 @@
fmt.Fprintf(w, `[
{
"hash": "451e372e48e0f6b1114fa0724aa79fa1",
- "last_modified": "Wed, 10 Nov 2009 23:00:00 GMT",
+ "last_modified": "2016-08-17T22:11:58.602650",
"bytes": 14,
"name": "goodbye",
"content_type": "application/octet-stream"
},
{
"hash": "451e372e48e0f6b1114fa0724aa79fa1",
- "last_modified": "Wed, 10 Nov 2009 23:00:00 GMT",
+ "last_modified": "2016-08-17T22:11:58.602650",
"bytes": 14,
"name": "hello",
"content_type": "application/octet-stream"
diff --git a/openstack/objectstorage/v1/objects/testing/requests_test.go b/openstack/objectstorage/v1/objects/testing/requests_test.go
index 7762d08..21f8e9d 100644
--- a/openstack/objectstorage/v1/objects/testing/requests_test.go
+++ b/openstack/objectstorage/v1/objects/testing/requests_test.go
@@ -14,6 +14,10 @@
fake "github.com/gophercloud/gophercloud/testhelper/client"
)
+var (
+ loc, _ = time.LoadLocation("GMT")
+)
+
func TestDownloadReader(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()