From 2e652f4cc72976ecc471a6c6f3b48afb3eb5a420 Mon Sep 17 00:00:00 2001 From: Alex Meade Date: Tue, 26 Jul 2011 16:42:16 -0400 Subject: Updated test stubs to contain the correct data Updated created and updated in responses to use correct time format --- nova/tests/api/openstack/test_servers.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py index 4ca79434f..e154fb4fa 100644 --- a/nova/tests/api/openstack/test_servers.py +++ b/nova/tests/api/openstack/test_servers.py @@ -16,6 +16,7 @@ # under the License. import base64 +import datetime import json import unittest from xml.dom import minidom @@ -172,8 +173,10 @@ def stub_instance(id, user_id=1, private_address=None, public_addresses=None, instance = { "id": int(id), - "created_at": "2010-10-10T12:00:00Z", - "updated_at": "2010-11-11T11:00:00Z", + "created_at": datetime.datetime.strptime("2010-10-10 12:00:00", + "%Y-%m-%d %H:%M:%S"), + "updated_at": datetime.datetime.strptime("2010-11-11 11:00:00", + "%Y-%m-%d %H:%M:%S"), "admin_pass": "", "user_id": user_id, "project_id": "", @@ -1048,8 +1051,10 @@ class ServersTest(test.TestCase): 'uuid': FAKE_UUID, 'instance_type': dict(inst_type), 'image_ref': image_ref, - 'created_at': '2010-10-10T12:00:00Z', - 'updated_at': '2010-11-11T11:00:00Z', + "created_at": datetime.datetime.strptime("2010-10-10 12:00:00", + "%Y-%m-%d %H:%M:%S"), + "updated_at": datetime.datetime.strptime("2010-11-11 11:00:00", + "%Y-%m-%d %H:%M:%S"), } def server_update(context, id, params): @@ -2901,8 +2906,10 @@ class ServersViewBuilderV11Test(test.TestCase): def _get_instance(self): instance = { "id": 1, - "created_at": "2010-10-10T12:00:00Z", - "updated_at": "2010-11-11T11:00:00Z", + "created_at": datetime.datetime.strptime("2010-10-10 12:00:00", + "%Y-%m-%d %H:%M:%S"), + "updated_at": datetime.datetime.strptime("2010-11-11 11:00:00", + "%Y-%m-%d %H:%M:%S"), "admin_pass": "", "user_id": "", "project_id": "", -- cgit