Use datetime object for fake network timestamps

The fake networks use a pre-serialized timestamp in str(datetime)
format which which doesn't give us the opportunity to test the
serialization code properly and isn't the format use in practice.

Use real dateime objects instead.

Full context here:

  http://lists.openstack.org/pipermail/openstack-dev/2014-April/033971.html

Change-Id: I5cbe722fb59cdd326b4c75dcfea14f206d71f668
This commit is contained in:
Mark McLoughlin 2014-04-29 12:28:48 +01:00
parent 6dd8210060
commit 41c45e4ba0
3 changed files with 9 additions and 8 deletions

View File

@ -5,7 +5,7 @@
"broadcast": "10.0.0.7",
"cidr": "10.0.0.0/29",
"cidr_v6": null,
"created_at": "2011-08-15 06:19:19.387525",
"created_at": "2011-08-15T06:19:19.387525",
"deleted": false,
"deleted_at": null,
"dhcp_start": "10.0.0.3",
@ -23,7 +23,7 @@
"priority": null,
"project_id": "1234",
"rxtx_base": null,
"updated_at": "2011-08-16 09:26:13.048257",
"updated_at": "2011-08-16T09:26:13.048257",
"vlan": 100,
"vpn_private_address": "10.0.0.2",
"vpn_public_address": "127.0.0.1",

View File

@ -6,7 +6,7 @@
"broadcast": "10.0.0.7",
"cidr": "10.0.0.0/29",
"cidr_v6": null,
"created_at": "2011-08-15 06:19:19.387525",
"created_at": "2011-08-15T06:19:19.387525",
"deleted": false,
"deleted_at": null,
"dhcp_start": "10.0.0.3",
@ -24,7 +24,7 @@
"priority": null,
"project_id": "1234",
"rxtx_base": null,
"updated_at": "2011-08-16 09:26:13.048257",
"updated_at": "2011-08-16T09:26:13.048257",
"vlan": 100,
"vpn_private_address": "10.0.0.2",
"vpn_public_address": "127.0.0.1",
@ -36,7 +36,7 @@
"broadcast": "10.0.0.15",
"cidr": "10.0.0.10/29",
"cidr_v6": null,
"created_at": "2011-08-15 06:19:19.885495",
"created_at": "2011-08-15T06:19:19.885495",
"deleted": false,
"deleted_at": null,
"dhcp_start": "10.0.0.11",

View File

@ -15,6 +15,7 @@
# under the License.
import copy
import datetime
import math
import uuid
@ -36,7 +37,7 @@ FAKE_NETWORKS = [
{
'bridge': 'br100', 'vpn_public_port': 1000,
'dhcp_start': '10.0.0.3', 'bridge_interface': 'eth0',
'updated_at': '2011-08-16 09:26:13.048257',
'updated_at': datetime.datetime(2011, 8, 16, 9, 26, 13, 48257),
'id': 1, 'uuid': '20c8acc0-f747-4d71-a389-46d078ebf047',
'cidr_v6': None, 'deleted_at': None,
'gateway': '10.0.0.1', 'label': 'mynet_0',
@ -48,7 +49,7 @@ FAKE_NETWORKS = [
'vpn_public_address': '127.0.0.1', 'multi_host': False,
'dns1': None, 'dns2': None, 'host': 'nsokolov-desktop',
'gateway_v6': None, 'netmask_v6': None, 'priority': None,
'created_at': '2011-08-15 06:19:19.387525',
'created_at': datetime.datetime(2011, 8, 15, 6, 19, 19, 387525),
},
{
'bridge': 'br101', 'vpn_public_port': 1001,
@ -63,7 +64,7 @@ FAKE_NETWORKS = [
'cidr': '10.0.0.10/29', 'vpn_public_address': None,
'multi_host': False, 'dns1': None, 'dns2': None, 'host': None,
'gateway_v6': None, 'netmask_v6': None, 'priority': None,
'created_at': '2011-08-15 06:19:19.885495',
'created_at': datetime.datetime(2011, 8, 15, 6, 19, 19, 885495),
},
]