pcs/122.patch
Adam Williamson f104d71fb7 Update to 0.9.155, fix tests with Python 3.6 and lxml 3.7
Fixes submitted upstream. Note on the change from `rm -r` to
`rm -rf`: there is a directory named `test` nested in another
directory named `test` (`pcs/test/tools/test`). Depending on
the order in which they're found, `rm -r` might wind up trying
to remove `pcs/test/tools/test` after `pcs/test`, which is an
error and causes %check to fail. `rm -rf` ignores missing
targets, so it succeeds even in this scenario.
2017-01-04 22:18:21 -08:00

32 lines
1.4 KiB
Diff

From cbc8eb0eeff7ac9076d1455ac4f54113c84dd693 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Wed, 4 Jan 2017 16:00:15 -0800
Subject: [PATCH] Fix tests for Python 3.6
We need to set a proper value for `env.booth.name` in two more
tests, or Python chokes trying to `os.path.join()` a MagicMock.
---
pcs/lib/commands/test/test_booth.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pcs/lib/commands/test/test_booth.py b/pcs/lib/commands/test/test_booth.py
index c24eea2..872760f 100644
--- a/pcs/lib/commands/test/test_booth.py
+++ b/pcs/lib/commands/test/test_booth.py
@@ -111,6 +111,7 @@ def test_raises_when_booth_config_in_use(self):
@patch_commands("parse", mock.Mock(side_effect=LibraryError()))
def test_raises_when_cannot_get_content_of_config(self):
env = mock.MagicMock()
+ env.booth.name = "somename"
assert_raise_library_error(
lambda: commands.config_destroy(env),
(
@@ -126,6 +127,7 @@ def test_raises_when_cannot_get_content_of_config(self):
@patch_commands("parse", mock.Mock(side_effect=LibraryError()))
def test_remove_config_even_if_cannot_get_its_content_when_forced(self):
env = mock.MagicMock()
+ env.booth.name = "somename"
env.report_processor = MockLibraryReportProcessor()
commands.config_destroy(env, ignore_config_load_problems=True)
env.booth.remove_config.assert_called_once_with()