from hamcrest import assert_that, calling, raises  # noqa H301
from pycontrail import exceptions


def test_network_deleting_with_server(network, server, contrail_api_client):
    assert_that(
        calling(contrail_api_client.virtual_network_delete).with_args(
            id=network['id']),
        raises(exceptions.RefsExistError))

Add test_network_deleting_with_server