

@mock.patch('see.context.resources.qemu.libvirt')
@mock.patch('see.context.resources.qemu.domain_create')
@mock.patch('see.context.resources.network.create')
def test_initialize_network(self, network_mock, create_mock, libvirt_mock):
    'Resources initializer with network.'
    network = mock.Mock()
    network.name.return_value = 'baz'
    network_mock.return_value = network
    resources = qemu.QEMUResources('foo', {
        'domain': 'bar',
        'network': 'baz',
        'disk': {
            'image': '/foo/bar',
        },
    })
    network_mock.assert_called_with(resources.hypervisor, 'foo', 'baz')
    create_mock.assert_called_with(create_mock.hypervisor, 'foo', 'bar', '/foo/bar', network_name='baz')

dataset/ETHPy150Open F-Secure/see/see/context/resources/test/qemu_test.py ResourcesTest.test_initialize_network/VarMisuse@116/206 `resources`->`create_mock`