# -*- mode: python -*-
from contextlib import contextmanager
from infinisim.infinibox import Infinibox

@contextmanager
def doctest_context():
    s = Infinibox()
    s.users.get_by_name('admin').set_password('password')
    s.activate()
    try:
        yield {
            "SYSTEM_ADDRESS": s.get_floating_addresses()[0],
        }
    finally:
        s.deactivate()
