moto/tests/test_ec2/test_general.py

22 lines
578 B
Python
Raw Normal View History

2013-02-22 04:13:01 +00:00
import boto
2013-03-06 03:11:58 +00:00
from boto.exception import EC2ResponseError
2013-08-03 21:21:25 +00:00
import sure # noqa
2013-02-22 04:13:01 +00:00
from moto import mock_ec2
@mock_ec2
2013-03-06 03:11:58 +00:00
def test_console_output():
conn = boto.connect_ec2('the_key', 'the_secret')
reservation = conn.run_instances('ami-1234abcd')
instance_id = reservation.instances[0].id
output = conn.get_console_output(instance_id)
output.output.should_not.equal(None)
@mock_ec2
def test_console_output_without_instance():
conn = boto.connect_ec2('the_key', 'the_secret')
conn.get_console_output.when.called_with('i-1234abcd').should.throw(Exception)