def METHOD_NAME(cobbler_api, input_verbose, input_what, expected_exception, mocker):
    # Arrange
    stub = create_autospec(spec=cobbler.actions.sync.CobblerSync)
    stub_dhcp = mocker.stub()
    stub_dns = mocker.stub()
    mocker.patch.object(cobbler_api, "get_sync", return_value=stub)
    mocker.patch.object(cobbler_api, "sync_dhcp", new=stub_dhcp)
    mocker.patch.object(cobbler_api, "sync_dns", new=stub_dns)
    # Act
    with expected_exception:
        cobbler_api.sync(input_verbose, input_what)
    # Assert
    if not input_what:
        stub.run.assert_called_once()
    if input_what and "dhcp" in input_what:
        stub_dhcp.assert_called_once()
    if input_what and "dns" in input_what:
        stub_dns.assert_called_once()