@mock.patch('see.context.resources.qemu.libvirt')
    @mock.patch('see.context.resources.qemu.domain_create')
    @mock.patch('see.context.resources.network.delete')
    @mock.patch('see.context.resources.qemu.pool_delete')
    @mock.patch('see.context.resources.qemu.domain_delete')
    def test_cleanup(self, delete_mock, pool_delete_mock, network_delete_mock, create_mock, libvirt_mock):
        resources = qemu.QEMUResources('foo', {'domain': 'bar', 'disk': {'image': '/foo/bar'}})
        resources._domain = mock.Mock()
        resources._network = mock.Mock()
        resources._hypervisor = mock.Mock()
        resources._storage_pool = mock.Mock()
        resources.cleanup()
        delete_mock.assert_called_with(resources.domain, mock.ANY)
        pool_delete_mock.assert_called_with(resources.storage_pool, mock.ANY)
        network_delete_mock.assert_called_with(resources.network)
        self.assertTrue(resources._hypervisor.close.called)
Creates the admin user.
dataset/ETHPy150Open F-Secure/see/see/context/resources/test/qemu_test.py/ResourcesTest.test_cleanup--crossover with--dataset/ETHPy150Open realpython/flask-skeleton/manage.py/create_admin