From: Rob Browning Date: Wed, 1 Jun 2011 00:49:28 +0000 (-0500) Subject: Verify the expected length of saved_errors in tmetadata.py. X-Git-Tag: bup-0.25-rc1~1^2~6 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0866907ebbcec952594fa0daf2d353ae73b23a2e;p=bup.git Verify the expected length of saved_errors in tmetadata.py. Signed-off-by: Rob Browning --- diff --git a/lib/bup/t/tmetadata.py b/lib/bup/t/tmetadata.py index 2d22799..fc5df0c 100644 --- a/lib/bup/t/tmetadata.py +++ b/lib/bup/t/tmetadata.py @@ -127,6 +127,7 @@ def test_from_path_error(): os.chmod(path, 000) metadata.from_path(path, archive_path=path, save_symlinks=True) if metadata.get_linux_file_attr: + WVPASS(len(helpers.saved_errors) == 1) errmsg = _first_err() WVPASS(errmsg.startswith('read Linux attr')) clear_errors() @@ -147,6 +148,7 @@ def test_apply_to_path_restricted_access(): WVPASSEQ(m.path, path) os.chmod(tmpdir, 000) m.apply_to_path(path) + WVPASS(len(helpers.saved_errors) == 1) errmsg = _first_err() WVPASS(errmsg.startswith('utime: ')) clear_errors() @@ -168,12 +170,14 @@ def test_restore_restricted_user_group(): orig_uid = m.uid m.uid = 0; m.apply_to_path(path, restore_numeric_ids=True) + WVPASS(len(helpers.saved_errors) == 1) errmsg = _first_err() WVPASS(errmsg.startswith('lchown: ')) clear_errors() m.uid = orig_uid m.gid = 0; m.apply_to_path(path, restore_numeric_ids=True) + WVPASS(len(helpers.saved_errors) == 1) errmsg = _first_err() WVPASS(errmsg.startswith('lchown: ') or os.stat(path).st_gid == m.gid) clear_errors()