similar to: Using assert_raise

Displaying 20 results from an estimated 90000 matches similar to: "Using assert_raise"

2006 Jul 18
2
Testing which RuntimeError is raised
I am just starting to use unit testing. Way cool. But I am not finding very clear docs on assert_raise. I have managed to write a test that tells me that the destroy I am trying to test fails with a RuntimeError (as it should). However, I would really like to test that it rails for the specific reason I have in my model. How can I get more specific? Am I going to have to create my own exception
2008 Oct 24
1
rescue_from and assert_raise
Since commit 5e3517ea7b9fbd460f772bffc9212d882011f2bc, rescue_from is now being handled in tests. I''ve been using rescue_from to handle custom exceptions and testing that those exceptions are raised in functional tests with assert_raise. This no longer works now. What''s the proper way to test this now? --~--~---------~--~----~------------~-------~--~----~ You received this
2006 May 06
6
assert_raises --> how does it work?
Hi, I have this code fragment: def test_delete_concept assert_not_nil Concept.find(concepts(:entreprise).id) get :delete_concept, {:concept_id => concepts(:entreprise).id} assert_raises :RecordNotFound, Concept.find(concepts(:entreprise).id) end basicaly, on the first line, I make sure that the concept exist in the DB. On the second line I delete the concept fron the DB.
2006 Dec 28
0
problem with assert_raise in Unit Test
I''m running a simple unit test to validate that ActiveRecord raises an exception when I try and update a column with a duplicate foreign key. Inside the unit test, charge.time_logs << time_logs(:first) will generate ActiveRecord::StatementInvalid: Mysql::Error: #23000Duplicate entry ''20'' for key 2: UPDATE time_logs SET `task_id` = 1, `date_created` = NULL,
2006 Apr 14
8
Error with Web Service tests after upgrading to Rails 1.1.2
Hello. I hope this is the right place to describe my problem ? After upgrading to Rails version 1.1.2 from rails version 1.0.0, Web Service functional tests seem broken. I upgraded rails (as the root user / administrator) with: # gem update rails --include-dependencies then I upgraded my application (as myself) with: ? rake rails:update % rake rails:update:configs After these steps,
2018 Aug 05
3
[PATCH] v2v: rhv-plugin: Use string literal concatenation
When splitting long strings over multiple lines, we can use string literal concatenation instead of +. See https://docs.python.org/3/reference/lexical_analysis.html#string-literal-concatenation --- .gnulib | 2 +- v2v/rhv-upload-plugin.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gnulib b/.gnulib index 5b78831df..646a44e1b 160000 ---
2018 Jun 05
2
[PATCH] v2v: Log full imageio response on failure.
Thanks: Nir Soffer --- v2v/rhv-upload-plugin.py | 66 ++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index 791c9e7d2..c3de7d555 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -228,6 +228,29 @@ def can_flush(h): def get_size(h): return
2019 Nov 28
3
[PATCH] rhv-upload: Fix waiting for transfer
We were not considering failures while initializing the transfer. In this case the transfer phase can change to PAUSED_SYSTEM or FINISHED_FAILURE, and transfer_url will be None, which failed the upload with a misleading error: RuntimeError: direct upload to host not supported, requires ovirt-engine >= 4.2 and only works when virt-v2v is run within the oVirt/RHV environment, eg. on
2018 Aug 08
2
[PATCH nbdkit] python: Try harder to print the full traceback on error.
The tracebacks are compressed into a single line because we're using PyObject_Str, but they are just about usable if not very readable. For example you would see an error like this: nbdkit: error: ./python-exception.py: config_complete: error: ['Traceback (most recent call last):\n', ' File "./python-exception.py", line 54, in config_complete\n raise_error1()\n',
2019 Sep 19
2
[PATCH] v2v: -o rhv-upload: cancel disk transfer on open failure
Make sure to cancel the trasfer in RHV in case of failure during the open/creation of the disk in RHV, so it is automatically removed. --- v2v/rhv-upload-plugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index 57e90484f..51a7f381a 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -193,12 +193,14 @@ def
2018 Dec 07
2
[PATCH] v2v: -o rhv-upload: Fix upload when using https
Fix rhv-cafile option access, broken by commit 6694028f9827 (v2v: -o rhv-upload: Only set SSL context for https connections). --- .gnulib | 2 +- v2v/rhv-upload-plugin.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gnulib b/.gnulib index 6ccfbb4ce..646a44e1b 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit
2011 Oct 20
2
[PATCH] pygrub: do not overload RuntimeError for "no menu.lst found"
From: pbonzini@redhat.com # HG changeset patch # User Paolo Bonzini <pbonzini@redhat.com> # Date 1319096986 -7200 # Node ID bd1f7361d3d7f4c767af21317fb4ec7ea1372f42 # Parent 1b110e895e285f43f14532e14c77597e54a0bcd2 pygrub will still try the next partition if run_grub exits with a "real" error, thus hiding the root cause from the trace. Defining a separate exception for "no
2019 Mar 17
2
[PATCH] v2v: rhv-upload-plugin - improve wait logic after finalize (RHBZ#1680361)
After invoking transfer_service.finalize, check operation status by examining ImageTransferPhase and DiskStatus. This is done instead of failing after a predefined timeout regardless the status. * not verified * Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1680361 --- v2v/rhv-upload-plugin.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git
2011 Jul 14
1
PyGrub And Grub2 Submenus
I recently updated the kernel on an Ubuntu 11.04 PVM domU. The dom0 is an up to date Debian Squeeze host (Xen 4.0.1). Attempting to start the domU after this with xm create gives "Error: Boot loader didn''t return any data!". I ran pygrub against the domU manually, I got the following: Traceback (most recent call last): File "/usr/lib/xen-default/bin/pygrub", line
2019 Mar 17
2
Re: [PATCH] v2v: rhv-upload-plugin - improve wait logic after finalize (RHBZ#1680361)
On Sun, Mar 17, 2019 at 2:59 PM Nir Soffer <nsoffer@redhat.com> wrote: > > On Sun, Mar 17, 2019 at 2:07 PM Daniel Erez <derez@redhat.com> wrote: >> >> After invoking transfer_service.finalize, check operation >> status by examining ImageTransferPhase and DiskStatus. >> This is done instead of failing after a predefined timeout >> regardless the
2019 Nov 17
2
Re: [PATCH 10/18] rhv-upload: Try to remove disk on timeout
On Mon, Nov 18, 2019 at 1:05 AM Nir Soffer <nirsof@gmail.com> wrote: > > If waiting for the disk to become OK times out, try to remove it. This > is likely to fail. Daniel, do you think this can succeed? > --- > v2v/rhv-upload-plugin.py | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/v2v/rhv-upload-plugin.py
2019 Sep 09
1
Re: [PATCH] v2v: rhv-upload-plugin - improve wait logic after finalize (RHBZ#1680361)
On Mon, Sep 9, 2019 at 7:02 PM Richard W.M. Jones <rjones@redhat.com> wrote: > From: Daniel Erez <derez@redhat.com> > > After invoking transfer_service.finalize, check operation status by > examining DiskStatus. This is done instead of failing after a > predefined timeout regardless the status. > > Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1680361 >
2019 Mar 17
2
Re: [PATCH v2] v2v: rhv-upload-plugin - improve wait logic after finalize (RHBZ#1680361)
On Sun, Mar 17, 2019 at 3:51 PM Daniel Erez <derez@redhat.com> wrote: > After invoking transfer_service.finalize, check operation > status by examining DiskStatus. > This is done instead of failing after a predefined timeout > regardless the status. > > * not verified * > > Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1680361 > --- >
2019 Nov 21
1
[PATCH] rhv-upload: Handle any error in NBD handlers
Currently we handle only HTTP errors like getting unexpected response code from imageio server. However if we could not send the request, or some other error is raised, we failed to mark the handle as failed, and finalized the transfer in close(). This may fool virt-v2v to create a VM with an empty or partially uploaded disk. Decorate all the NBD hander functions with a @failing decorator,
2012 Jan 18
2
virt-manager 0.9.0-r2 gentoo, no starting
getting this when starting virt-manager databunka src # virt-manager Traceback (most recent call last): File "/usr/share/virt-manager/virt-manager.py", line 383, in <module> main() File "/usr/share/virt-manager/virt-manager.py", line 285, in main raise RuntimeError(_("Unable to initialize GTK: %s") % gtk_error) RuntimeError: Kann GTK nicht