@mock_ec2_deprecated
def test_remove_tag():
    conn = boto.connect_ec2('the_key', 'the_secret')
    reservation = conn.run_instances(EXAMPLE_AMI_ID)
    instance = reservation.instances[0]
    instance.add_tag('a key', 'some value')
    tags = conn.get_all_tags()
    tag = tags[0]
    tag.name.should.equal('a key')
    tag.value.should.equal('some value')
    with pytest.raises(EC2ResponseError) as ex:
        instance.remove_tag('a key', dry_run=True)
    ex.value.error_code.should.equal('DryRunOperation')
    ex.value.status.should.equal(400)
    ex.value.message.should.equal('An error occurred (DryRunOperation) when calling the DeleteTags operation: Request would have succeeded, but DryRun flag is set')
    instance.remove_tag('a key')
    conn.get_all_tags().should.have.length_of(0)
    instance.add_tag('a key', 'some value')
    conn.get_all_tags().should.have.length_of(1)
    instance.remove_tag('a key', 'some value')
@mock_ec2_deprecated
def test_remove_tag():
    conn = boto.connect_ec2('the_key', 'the_secret')
    reservation = conn.run_instances(EXAMPLE_AMI_ID)
    instance = reservation.instances[0]
    instance.add_tag('a key', 'some value')
    tags = conn.get_all_tags()
    tag = tags[0]
    tag.name.should.equal('a key')
    tag.value.should.equal('some value')
    with pytest.raises(EC2ResponseError) as ex:
        instance.remove_tag('a key', dry_run=True)
    ex.value.error_code.should.equal('DryRunOperation')
    ex.value.status.should.equal(400)
    ex.value.message.should.equal('An error occurred (DryRunOperation) when calling the DeleteTags operation: Request would have succeeded, but DryRun flag is set')
    instance.remove_tag('a key')
    conn.get_all_tags().should.have.length_of(0)
    instance.add_tag('a key', 'some value')
    conn.get_all_tags().should.have.length_of(1)
    instance.remove_tag('a key', 'some value')