From 40b97d1bb29e7d79bcc34070d0903724139f1747 Mon Sep 17 00:00:00 2001 From: Chris Henry Date: Sun, 18 Jan 2015 16:30:39 -0500 Subject: [PATCH] Test that launch_time is a iso 8601 string. --- tests/test_ec2/test_instances.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_ec2/test_instances.py b/tests/test_ec2/test_instances.py index 4036f1214..346eef514 100644 --- a/tests/test_ec2/test_instances.py +++ b/tests/test_ec2/test_instances.py @@ -4,6 +4,7 @@ import tests.backport_assert_raises from nose.tools import assert_raises import base64 +import datetime import boto from boto.ec2.instance import Reservation, InstanceAttribute @@ -50,6 +51,7 @@ def test_instance_launch_and_terminate(): instances.should.have.length_of(1) instances[0].id.should.equal(instance.id) instances[0].state.should.equal('running') + datetime.datetime.strptime(instances[0].launch_time, '%Y-%m-%dT%H:%M:%S.%f') root_device_name = instances[0].root_device_name instances[0].block_device_mapping[root_device_name].status.should.equal('attached') @@ -604,13 +606,13 @@ def test_describe_instance_status_with_non_running_instances(): @mock_ec2 def test_get_instance_by_security_group(): conn = boto.connect_ec2('the_key', 'the_secret') - + conn.run_instances('ami-1234abcd') instance = conn.get_only_instances()[0] security_group = conn.create_security_group('test', 'test') conn.modify_instance_attribute(instance.id, "groupSet", [security_group.id]) - + security_group_instances = security_group.instances() assert len(security_group_instances) == 1