diff --git a/bodhi-tests-rawhide.patch b/bodhi-tests-rawhide.patch index 40de03f..b4e1902 100644 --- a/bodhi-tests-rawhide.patch +++ b/bodhi-tests-rawhide.patch @@ -1,4 +1,4 @@ -commit 464d0e57656fbd5642df70857d46331738de05e6 +commit d9176570166e0b0cac14af7f0789476fca30a493 Author: Aurélien Bompard Date: Thu Jul 25 17:34:25 2019 +0200 @@ -7,35 +7,37 @@ Date: Thu Jul 25 17:34:25 2019 +0200 Signed-off-by: Aurélien Bompard diff --git a/bodhi/tests/client/test___init__.py b/bodhi/tests/client/test___init__.py -index a06780a3..a287b835 100644 +index a06780a3..3b824a17 100644 --- a/bodhi/tests/client/test___init__.py +++ b/bodhi/tests/client/test___init__.py -@@ -993,7 +993,13 @@ class TestQuery(unittest.TestCase): +@@ -993,7 +993,14 @@ class TestQuery(unittest.TestCase): ) ] self.assertEqual(send_request.mock_calls, calls) - mock_open.assert_called_with(fedora.client.openidbaseclient.b_SESSION_FILE, 'rb') + # Before F31 the file was opened in binary mode, and then it changed. + # Only check the path. -+ self.assertEqual(mock_open.call_count, 1) -+ self.assertEqual( -+ mock_open.call_args[0][0], -+ fedora.client.openidbaseclient.b_SESSION_FILE ++ self.assertNotEqual(mock_open.call_count, 0) ++ first_args = [args[0][0] for args in mock_open.call_args_list] ++ self.assertIn( ++ fedora.client.openidbaseclient.b_SESSION_FILE, ++ first_args + ) @mock.patch('bodhi.client.bindings.BodhiClient.csrf', mock.MagicMock(return_value='a_csrf_token')) -@@ -1128,7 +1134,13 @@ class TestQueryBuildrootOverrides(unittest.TestCase): +@@ -1128,7 +1135,14 @@ class TestQueryBuildrootOverrides(unittest.TestCase): ) ] self.assertEqual(send_request.mock_calls, calls) - mock_open.assert_called_with(fedora.client.openidbaseclient.b_SESSION_FILE, 'rb') + # Before F31 the file was opened in binary mode, and then it changed. + # Only check the path. -+ self.assertEqual(mock_open.call_count, 1) -+ self.assertEqual( -+ mock_open.call_args[0][0], -+ fedora.client.openidbaseclient.b_SESSION_FILE ++ self.assertNotEqual(mock_open.call_count, 0) ++ first_args = [args[0][0] for args in mock_open.call_args_list] ++ self.assertIn( ++ fedora.client.openidbaseclient.b_SESSION_FILE, ++ first_args + ) @mock.patch('bodhi.client.bindings.BodhiClient.csrf',